0

As many others, I'm having trouble fitting a long table into my report. I am using the long table package, however it doesn't work for me.

The table coding is shown shortly below

\begin{longtable}[H]
\begin{tabular}{
>{\columncolor[HTML]{AFDBAF}}l |l|l|}
\hline
\multicolumn{1}{|l|}{\cellcolor[HTML]{AFDBAF}\textbf{Søgenummer}} & \cellcolor[HTML]{AFDBAF}\textbf{Søgedetaljer}                                                                                                                                                                                                                     & \cellcolor[HTML]{AFDBAF}\textbf{Resultater}

...

\hline \end{tabular} \end{longtable}

Sadly, It won't allow me to insert the complete coding - however I'm positive, that the changes in the coding should me inserted before and after the content of the table.

Anyway, this results in multiple errors and the table not showing in the PDF-file when compiled.

My preamble coding is just:

\usepackage{longtable}

Am I missing something simple here?

When not using the long table code, but just "table", it results in the table going over the margin both vertically and horisontally.

So my question is: How do I get this very long table to fit in the text on multiple pages without crossing any margins?

Calisi
  • 1
  • You need to provide an example if you want someone to debug. Longtable has no H option though so you may remove that. – David Carlisle Dec 12 '22 at 12:17
  • l |l|l|} specifies 3 colums all as wide as their text, so if that is too wide, make the text smaller,eg\footnotesize or allow breaking in colums replace l by p{3cm} or some width – David Carlisle Dec 12 '22 at 12:21
  • 1
    also remove tabular if you are using longtable (I assume that is just in this sketch not your real code) This is why it is always better to post complete tested document that shows the problem – David Carlisle Dec 12 '22 at 12:24
  • @DavidCarlisle Thank you, both \footnotesize and removing "tabular" fixed it! – Calisi Dec 20 '22 at 22:22

0 Answers0