I've read several forum posts on longtable package, but I'm still really struggling.
I'm trying to insert a table into my thesis, I've used https://www.tablesgenerator.com/ to convert my excel table into Latex and from here I'm manually editing.
The problem is, the table is too wide and too tall. I've used scriptsize text and I've added in the longtable package. I don't want the table in landscape, so that's not an option. It's now breaking over two pages, which I'm happy with. However, I can't see half of the 3rd column and the 4th one at all.
\begin{centering}
\scriptsize
\begin{longtable}{|c|c|c|c|}
\noalign{\vspace*{\fill}}
data here
\noalign{\vspace*{\fill}}
\end{longtable}
\end{centering}
Additionally, is there a way to centre the text in the middle of the box and make the first column narrower?
Sorry if I've missed something obvious, I've read the documentation but still can't get my head around it
xltabularpackage. It combines the features oflongtable(mid-table page breaks) andtabularx(adjust table to textwidth while allowing linebreaks inside of cells). – leandriis Jul 24 '20 at 17:02chemforumlaormhchemas the current representation of phosphate without proper super- and subscripts just looks wrong. – leandriis Jul 24 '20 at 17:03\begin{xltabular}{\linewidth}{@{} X {}} \centering \begin{tabular}{|l|l|l|l|} \hline *TABLE BODY *\hline \end{tabular} \end{xltabular}but it's not happy! – Sammie Davies Jul 24 '20 at 17:55longtablewithxltabular. Something like\begin{xltabular}{\linewidth}{cXXX}should get you started. What to do exactly depends how wide the contents of your table are. – leandriis Jul 24 '20 at 18:10\usepackage{makecell} \renewcommand{\theadfont}{\normalsize\bfseries}to your preamble and use\thead{first line \\ second line \\ of column header}inside of xltabular. – leandriis Jul 24 '20 at 18:14cwould be a centered column that is as wide as the widest content of this column,Xis the column type introduced bytabularx. This column type is as wide as the space that is needed to make the overall width of the table equal to the width you declared. (In your case,\textwidth). Linebreaks are automatically added and the text inXtype columns is justified. If you want to change that, take a look here: Centering in tabularx and X columns – leandriis Jul 24 '20 at 19:36Xtype columns, all of them share the same width. If you want to change that, take a look here: Table layout with tabularx (column widths: 50%|25%|25%) Although both linked questions and their answers deal withtabularx, they are applicable toxltabularas well. – leandriis Jul 24 '20 at 19:36\thead{Approximate \\ Raman shift\\ (cm-1)}. Don't forget to include themakecellpackage. – leandriis Jul 24 '20 at 19:57