I have a created a table in LaTeX which goes straight out of the page on the right side (fig shown). This is a 14 by 6 table. The kind of format I want to achieve is something like the one given in MS word.

Table in latex I’ve created:
The skeleton i've used:
\documentclass{article}
\usepackage{booktabs}
\usepackage{longtable}
\usepackage[margin=1in]{geometry}
\usepackage{pdflscape}
\usepackage{graphicx}
\begin {document}
\setlength\LTleft{0pt}
\setlength\LTright{0pt}
\begin{longtable}{@{\extracolsep{\fill}}|*{6}{c|}}
\caption{Multipage table.}
\label{tab:table1}\
\toprule
\textbf{Author}
& \textbf{Year of Publication}
& \textbf{Mainly focusing problem/area}
& \textbf{Any specific layered architecture}
& \textbf{Main points}
& \textbf{Any observable fault} \
\midrule
\endfirsthead
\toprule
\textbf{Author}
& \textbf{Year of Publication}
& \textbf{Mainly focusing problem/area}
& \textbf{Any specific layered architecture}
& \textbf{Main points}
& \textbf{Any observable fault} \
\midrule
\endhead
%...My 14 rows each accommodating 6 columns…%
\bottomrule
\end{longtable}
\end{document}
How can I adjust the table in \texwidth and allow it to vertically expand? The reason I used booktabs here, is to allow the table to go on the next page (if required).
P.S. I also used tabularx (image attached), but the problem is, table doesn’t fit the whole page (last 2 rows are attached but not displayed due to margins I guess), given a reasonable format.
latex table using tabularx:
Skeleton for creating table using tabularx
\documentclass{article}
\usepackage{geometry} % more generous margins
\usepackage{tabularx}
\renewcommand*{\tabularxcolumn}[1]{>{\centering\arraybackslash}m{#1}}
\begin{document}
\begin{table}[t!]
\caption{Comparison of some unique works in IoT Transportation}
\begin{tabularx}{\textwidth}{|*{6}{X|}}
%....%
\end {tabularx}
\end{tabular}
\end{document}
For reference, ive also consulted the following links, but couldn't manage to solve my problem: Link1 Link2 Link3


booktabshas nothing to do with allowing table to span multiple pages.booktabsprovides horizontal lines with improved spacing sich as\toprule,\midruleand\bottomrulethatn can be used instead of\hline. Packages that allow ables to occupy multiple pages includelongtable,xltabularandtabularray. – leandriis Mar 05 '22 at 17:51booktabsandlongtableas shown in above code, but still couldn't get the format right – afaq Mar 05 '22 at 18:25booktabs&longtablebut couldn't get the formatting right plus table goes out of the page. – afaq Mar 05 '22 at 18:27longtablebut change*{6}{c|}asccolumns are 1-line text: you want something likellp{3cm}lp{3cm}p{3cm}choosing whatever widths you need. – David Carlisle Mar 05 '22 at 18:35