Table is too big in pdf

longtablepdftextables

I am writing my thesis. I need a small help. I have a comparison table inserted in my book but the way it looks on pdf is too big and hard to read. Could you suggest a different way of adding this tabular?.
As you can see in the attached image that it takes too much space in between one single page. I expect something like I showed in the table green but in black and white.

For the code below, the resulting pdf is shown in second image.
To run this code, please open overleaf and create main.tex and background and related work.tex file and then run main.tex to replicate the content.

main.tex

\documentclass[a4paper,oneside,12pt]{book}
\usepackage{booktabs,xltabular,ragged2e,glossaries}
\newcolumntype{P}[1]{>{\RaggedRight}p{#1}}
\newcolumntype{L}{>{\RaggedRight}X}

\begin{document}


\pagenumbering{roman} \setcounter{page}{1} % to start with roman page numbering

\cleardoublepage

\tableofcontents 


% Print list of abbreviations, list of tables and list of figures
\printnoidxglossary[nopostdot,nonumberlist,title=List of Abbreviations] 
\listoftables 
\listoffigures 
% Includes the pdf of the paper. It will give an error if the pdf is not available.


\clearpage \pagenumbering{arabic}
\setcounter{page}{1}
\clearpage
\setlength{\textheight}{9in}

%start of main document
\input{background and related work}


\clearpage

\nocite{*}
\bibliographystyle{unsrt}
\addcontentsline{toc}{chapter}{Bibliography}
\bibliography{chapters/bibliography} 

\end{document}

background and related work.tex

\begin{xltabular}{\linewidth}{ @{}
  P{.15\textwidth}
  P{.15\textwidth}
  L
  P{.15\textwidth}
  P{.15\textwidth}
  @{} }
  
\caption{Related works on computer vision (Comparison table)}
\label{my-label}\\
\toprule 
Topic & Goal & Idea & Technique  & Use case\\
\midrule 
\endfirsthead

\multicolumn{5}{@{}l}{Table \thetable, cont'd}\\[1ex]
\toprule 
Topic & Goal & Technique & Idea  & Use case\\
\midrule 
\endhead

\bottomrule
\endlastfoot

Computer vision tasks & Localization & To perform localization is to define a bounding box enclosing the object in the image &To find the location of the objects in a set of images & Useful for creating dataset when combined with classifier where we need to crop images \\

Computer vision tasks & Object detection (Fast R-CNN, R-CNN, Faster R-CNN, Mask R-CNN, SSD, YOLO, Data Augmentation, Haar cascade, objects as points) & To define objects within images involving outputting of bounding boxes and labels for individual objects. Purpose is to find the object and classify a N number of objects in an image & To identify and locate objects in an image or video & Powerful in classifying several objects within a digital image at once. \\


\end{xltabular}%

My code pdf
Expectations

Best Answer

enter image description here

  • your question is actually duplication to question my-table-doesnt-fit-what-are-my-options
  • please always provide MWE (Minimal Working Example), a small but complete document, which reproduce your problem as it is (help us to help you)
  • your table is quite big, so you should consider to rotate it to landscape orientation and use smaller font size
  • with use pdflscape (for use landscape environment) and tabularray package for longtblr table, a possible MWE is:
\documentclass[a4paper,oneside,12pt]{book}
\usepackage{tabularray}
\usepackage{pdflscape}

\begin{document}

\begin{landscape}
%\mbox{}\vfil
    \begin{longtblr}[
  caption = {Related works on computer vision},
    label = {tab:my-label},
                    ]{hline{1,Z} = {1pt}, hline{2}={0.6pt},
                      colspec={X[1,l] X[2,l] X[3,l] X[2,l] X[2,l]},
                      colsep=3pt, rowsep=3pt,
                      rowhead=1,
                      rows={font=\small},
                      row{1} = {font=\small\bfseries},
                    }
% column headers
Topic 
    & Goal 
        & Idea 
            & Technique  
                & Use case  \\
% table body
Computer vision tasks & Localization 
    & To perform localization is to define a bounding box enclosing the object in the image 
        & To find the location of the objects in a set of images 
            & Useful for creating dataset when combined with classifier where we need to crop images     \\
Computer vision tasks 
    & Object detection (Fast R-CNN, R-CNN, Faster R-CNN, Mask R-CNN, SSD, YOLO, Data Augmentation, Haar cascade, objects as points) 
        & To define objects within images involving outputting of bounding boxes and labels for individual objects. Purpose is to find the object and classify a N number of objects in an image 
            & To identify and locate objects in an image or video 
                & Powerful in classifying several objects within a digital image at once. \\
    \end{longtblr}
\end{landscape}

\end{document}