1

This question already has an answer here:

I have rather large tables, one of them so large that I need to rotate it. So I tried a longtable inside of the lscape environment. Now, I have the problem that only some of the columns fit on the page, and the rest just disappear. Also, when there are more rows, the table goes over the margin on the right visualized by \showframe. The table in my minimal example is not long enough because I didn't want to post such a long table, but you can just copy the content several times.

 \documentclass[
%, draft
, 12pt
, a4paper
, english
, numbers=noenddot
, bibliography=totoc
, xcolor=dvipsnames
]{scrreprt}

\usepackage{longtable}
\usepackage{subfig}
\usepackage{floatrow}
\usepackage{caption}
\usepackage{geometry}

\usepackage{lscape}
\usepackage{booktabs}
\usepackage{showframe}


\begin{document}
\newgeometry{bottom=55pt} 
\pagenumbering{arabic}


\subsection{Uebersicht}


\begin{landscape}

\begin{longtable} {|c|c|c|c|c|c|c|}

\toprule
\bfseries Abbreviation from Table 1 & Construct & Measure & English Version (Reference){[}OV = original version, OT=official translation, IT=inofficial translation{]} & German Version (Reference){[}OV = original version, OT=official translation, IT=inofficial translation, OV = items / scales developed forstudy{]} & \hspace{0pt}Number of items & \hspace{0pt}Remarks \\ 
\hline 
\endhead
\\ \hline
\multicolumn{2}{l}{continued on the next page...} \\
\endfoot


%\\ \hline
\endlastfoot


    \multicolumn{7}{p{16cm}}{\bfseries Well-being}\\
    \hline
    aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaaaaaaaaa aaaa aaaaaaaaaaaaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaaaaaaaaa aaaa aaaaaaaaaaaaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaaaaaaaaa aaaa aaaaaaaaaaaaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaaaaaaaaa aaaa aaaaaaaaaaaaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaaaaaaaaa aaaa aaaaaaaaaaaaaaaaa aaaaaaaaa aaaaaaaaa & 20 &  \\
    aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaaaaaaaaa aaaa aaaaaaaaaaaaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaaaaaaaaa aaaa aaaaaaaaaaaaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaaaaaaaaa aaaa aaaaaaaaaaaaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaaaaaaaaa aaaa aaaaaaaaaaaaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaaaaaaaaa aaaa aaaaaaaaaaaaaaaaa aaaaaaaaa aaaaaaaaa & 20 &  \\
    aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaaaaaaaaa aaaa aaaaaaaaaaaaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaaaaaaaaa aaaa aaaaaaaaaaaaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaaaaaaaaa aaaa aaaaaaaaaaaaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaaaaaaaaa aaaa aaaaaaaaaaaaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaaaaaaaaa aaaa aaaaaaaaaaaaaaaaa aaaaaaaaa aaaaaaaaa & 20 &  \\
    aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaaaaaaaaa aaaa aaaaaaaaaaaaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaaaaaaaaa aaaa aaaaaaaaaaaaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaaaaaaaaa aaaa aaaaaaaaaaaaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaaaaaaaaa aaaa aaaaaaaaaaaaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaaaaaaaaa aaaa aaaaaaaaaaaaaaaaa aaaaaaaaa aaaaaaaaa & 20 &  \\
    aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaaaaaaaaa aaaa aaaaaaaaaaaaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaaaaaaaaa aaaa aaaaaaaaaaaaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaaaaaaaaa aaaa aaaaaaaaaaaaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaaaaaaaaa aaaa aaaaaaaaaaaaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaaaaaaaaa aaaa aaaaaaaaaaaaaaaaa aaaaaaaaa aaaaaaaaa & 20 &  \\
    aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaaaaaaaaa aaaa aaaaaaaaaaaaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaaaaaaaaa aaaa aaaaaaaaaaaaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaaaaaaaaa aaaa aaaaaaaaaaaaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaaaaaaaaa aaaa aaaaaaaaaaaaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaaaaaaaaa aaaa aaaaaaaaaaaaaaaaa aaaaaaaaa aaaaaaaaa & 20 &  \\
    aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaaaaaaaaa aaaa aaaaaaaaaaaaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaaaaaaaaa aaaa aaaaaaaaaaaaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaaaaaaaaa aaaa aaaaaaaaaaaaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaaaaaaaaa aaaa aaaaaaaaaaaaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaaaaaaaaa aaaa aaaaaaaaaaaaaaaaa aaaaaaaaa aaaaaaaaa & 20 &  \\
\bottomrule

\end{longtable}


\end{landscape}
\end{document}

Edit: I need a general example, not one where I have to change every single column, as I will be using this table many times.

marked as duplicate by Schweinebacke, Stefan Pinnow, Mico, egreg, Jesse May 12 '17 at 11:11

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    Even the table head is much to wide. You need, e.g., p-columns instead of c-columns to place all the text after English Version and after German Version. – Schweinebacke May 12 '17 at 8:09
  • 1
    If I use p instead of c, I get many errors and the document looks completely messed up... So I figured I couldn't use that... – LizzAlice May 12 '17 at 8:15
  • 1
    Then you have done something wrong with the p-columns and you should have shown, what you have done. They do work. See my answer below. – Schweinebacke May 12 '17 at 8:54
  • 5
2

Line breaks are only available in p-columns (and derived column types). So you cannot use c-columns for columns, that need line breaks. The p-column declaration has one argument: The width of the column. A p-column is something like a \parbox. So by default the text in the column in justified. But using package array you can change the default adding >{\raggedright}, >{\centering} or >{\raggedleft} bevor the column declaration to have left aligned, centered or right aligned columns with automatic (or manual) line breaks. But note, that this would also change \\ to be a line break instead of a tabular row end. See \arraybackslash in the array manual so learn how to fix this. An alternative to \raggedright, \centering and \raggedleft would be to use package ragged2e's \RaggedRight, \Centering or \RaggedLeft. These not only allow hyphenation but also avoids the \\-problem.

\documentclass[
%, draft
, 12pt
, a4paper
, english
, numbers=noenddot
, bibliography=totoc
, xcolor=dvipsnames
]{scrreprt}

\usepackage{longtable}
\usepackage{subfig}
\usepackage{floatrow}
\usepackage{caption}
\usepackage{geometry}

\usepackage{pdflscape}% show it readable
\usepackage{booktabs}
\usepackage{array}
\usepackage{showframe}
\usepackage{ragged2e}
\usepackage{scrhack}% without showframe shows the wrong frame on landscape pages


\begin{document}
\newgeometry{bottom=55pt} 
\pagenumbering{arabic}


\subsection{Uebersicht}


\begin{landscape}
%\begin{longtable} {*5{>{\Centering}p{\dimexpr ((\linewidth-4.5em)/6)-2\tabcolsep\relax}}>{\Centering}p{\dimexpr 4.5em-2\tabcolsep}>{\Centering}p{\dimexpr ((\linewidth-4.5em)/6)-2\tabcolsep\relax}}
\begin{longtable} {|*5{>{\Centering}p{\dimexpr
  ((\linewidth-4.5em)/6)-2\tabcolsep-\arrayrulewidth\relax}|}>{\Centering}p{\dimexpr 4.5em-2\tabcolsep-\arrayrulewidth}|>{\Centering}p{\dimexpr ((\linewidth-4.5em)/6)-2\tabcolsep-\arrayrulewidth\relax}|}
\toprule
\bfseries Abbreviation from Table 1 & Construct & Measure & English Version (Reference)\par\footnotesize{[}OV = original version,\par OT=official translation,\par IT=inofficial translation{]} & German Version (Reference)\par\footnotesize{[}OV = original version,\par OT=official translation,\par IT=inofficial translation,\par OV = items / scales developed forstudy{]} & Number of items & Remarks \\ 
\midrule
\endhead
\\
\midrule
\multicolumn{2}{l}{continued on the next page...} \\
\endfoot
\bottomrule
\endlastfoot
  \multicolumn{7}{l}{\bfseries Well-being}\\
\midrule
  some dummy text that allows hyphenation &
  some dummy text that allows hyphenation &
  some dummy text that allows hyphenation &
  some dummy text that allows hyphenation &
  some dummy text that allows hyphenation &
  20 & \\
  some dummy text that allows hyphenation &
  some dummy text that allows hyphenation &
  some dummy text that allows hyphenation &
  some dummy text that allows hyphenation &
  some dummy text that allows hyphenation &
  20 & \\
  some dummy text that allows hyphenation &
  some dummy text that allows hyphenation &
  some dummy text that allows hyphenation &
  some dummy text that allows hyphenation &
  some dummy text that allows hyphenation &
  20 & \\
  some dummy text that allows hyphenation &
  some dummy text that allows hyphenation &
  some dummy text that allows hyphenation &
  some dummy text that allows hyphenation &
  some dummy text that allows hyphenation &
  20 & \\
  some dummy text that allows hyphenation &
  some dummy text that allows hyphenation &
  some dummy text that allows hyphenation &
  some dummy text that allows hyphenation &
  some dummy text that allows hyphenation &
  20 & \\
\end{longtable}

\end{landscape}
\end{document}

enter image description here

In this example I've used \dimexpr to calculate the maximum width for the columns (and each the same). Each column starts with a white space of width \tabcolsep and ends with a white space of \tabcolsep plus the width of the vertical rule \arrayrulewidth. So the calculation of the column width is easy, if almost all columns should have the same width. To show you how to set an individual width, I've used a different width for the 6th column. As you should know *5{…} means: repeat 5 times declaration {…}.

But I would recommend to avoid the vertical rules in tables, i.e., if you are using booktabs. That would be the version with activates %-line and commented second \begin{longtable}:

enter image description here

Note: That the result of showframe package is wrong on landscape pages of package lscape or pdflscape. Package scrhack fixes this issue (and several other issues).

And maybe something with only centered (but bold) heads would be better:

\documentclass[12pt]{scrreprt}

\usepackage{longtable}
\usepackage{geometry}

\usepackage{pdflscape}% show it readable
\usepackage{booktabs}
\usepackage{array}
\usepackage{showframe}
\usepackage{ragged2e}
\usepackage{scrhack}% without showframe shows the wrong frame on landscape pages


\begin{document}
\newgeometry{bottom=55pt} 
\pagenumbering{arabic}


\subsection{Uebersicht}


\begin{landscape}
\begin{longtable} {*5{>{\RaggedRight}p{\dimexpr
  ((\linewidth-4.5em)/6)-2\tabcolsep\relax}}>{\Centering}p{\dimexpr 4.5em-2\tabcolsep}>{\RaggedRight}p{\dimexpr ((\linewidth-4.5em)/6)-2\tabcolsep\relax}}
%\begin{longtable} {|*5{>{\Centering}p{\dimexpr
%  ((\linewidth-4.5em)/6)-2\tabcolsep-\arrayrulewidth\relax}|}>{\Centering}p{\dimexpr 4.5em-2\tabcolsep-\arrayrulewidth}|>{\Centering}p{\dimexpr ((\linewidth-4.5em)/6)-2\tabcolsep-\arrayrulewidth\relax}|}
\toprule
\bfseries\Centering Abbreviation from Table 1 & 
\bfseries\Centering Construct &
\bfseries\Centering Measure & 
\Centering \textbf{English Version (Reference)}\par \footnotesize{[}OV = original
    version,\par OT=official translation,\par IT=inofficial translation{]} & 
\Centering \textbf{German Version (Reference)}\par\footnotesize{[}OV = original version,\par OT=official translation,\par IT=inofficial translation,\par OV = items / scales developed forstudy{]} &
\bfseries\Centering Number of items & 
\bfseries\Centering Remarks \\ 
\midrule
\endhead
\\
\midrule
\multicolumn{2}{l}{continued on the next page...} \\
\endfoot
\bottomrule
\endlastfoot
  \multicolumn{7}{l}{\bfseries Well-being}\\
\midrule
  some dummy text that allows hyphenation &
  some dummy text that allows hyphenation &
  some dummy text that allows hyphenation &
  some dummy text that allows hyphenation &
  some dummy text that allows hyphenation &
  20 & \\
  some dummy text that allows hyphenation &
  some dummy text that allows hyphenation &
  some dummy text that allows hyphenation &
  some dummy text that allows hyphenation &
  some dummy text that allows hyphenation &
  20 & \\
  some dummy text that allows hyphenation &
  some dummy text that allows hyphenation &
  some dummy text that allows hyphenation &
  some dummy text that allows hyphenation &
  some dummy text that allows hyphenation &
  20 & \\
  some dummy text that allows hyphenation &
  some dummy text that allows hyphenation &
  some dummy text that allows hyphenation &
  some dummy text that allows hyphenation &
  some dummy text that allows hyphenation &
  20 & \\
  some dummy text that allows hyphenation &
  some dummy text that allows hyphenation &
  some dummy text that allows hyphenation &
  some dummy text that allows hyphenation &
  some dummy text that allows hyphenation &
  20 & \\
\end{longtable}

\end{landscape}
\end{document}

enter image description here

  • This works better than anything I have tried so far, but there are still a few issues: it would be great if the column width would adjust to the amount of text it contains, in order for columns with more text to be wider; or if there was a way to adjust this manually. Also, I need the vertical lines because there is a din standard that says that they should be there, but soemtimes, they just stop before reaching the bottom line of the table. Can this be fixed somehow? – LizzAlice May 12 '17 at 9:15
  • 1
    @LizzAlice You can adjust the with of each column with the argument of the p-column identifier. See any introduction to LaTeX and, e.g., tex.stackexchange.com/questions/223856/…. If you have only some columns with contents that should have line breaks, use p-columns only for those. If you need framed table cells, don't use booktabs. It wouldn't make sense. But such tables are ugly and often hard to read. – Schweinebacke May 12 '17 at 9:19
1

If you want cells to wrap text, don't use the standard l,r or c specifiers, and if you want the table to fit page, use tabularx. For long tables, the ltablex package brings the functionalities of longtable to tabularx.

\documentclass[
%, draft
, 12pt
, a4paper
, english
, numbers=noenddot
, bibliography=totoc
, xcolor=dvipsnames
]{scrreprt}

\usepackage{longtable, ltablex}
\usepackage{subfig}
\usepackage{floatrow}
\usepackage{caption}
\usepackage{geometry}

\usepackage{lscape}
\usepackage{booktabs}
\usepackage{ragged2e}
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.3pt}

\begin{document}
\newgeometry{bottom=55pt}
\pagenumbering{arabic}


\subsection{Uebersicht}


\begin{landscape}
\keepXColumns
\renewcommand\aboverulesep{0pt}
\renewcommand\belowrulesep{0pt}
\setlength\extrarowheight{2pt}
\begin{tabularx}{\linewidth} {|*{7}{ >{\RaggedRight\small\arraybackslash}X|}}
\toprule
\bfseries Abbreviation from Table 1 & Construct & Measure & English Version (Reference){[}OV = original version, OT=official translation, IT=inofficial translation{]} & German Version (Reference){[}OV = original version, OT=official translation, IT=inofficial translation, OV = items / scales developed forstudy{]} & \hspace{0pt}Number of items & \hspace{0pt}Remarks \\
\hline
\endhead
\hline
\multicolumn{2}{l}{continued on the next page...} \\
\endfoot
%\\ \hline
\endlastfoot
    \multicolumn{7}{l}{\bfseries Well-being}\\
    \hline
    aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaa aaaaaaa aa aaaa aaaaaaaaaa aaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaa aaaaaaa aaaa aaaaaaaaaa aaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaa aaaaaaa aaaa aaaaaaaaaa aaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaa aaaaaaa aaaa aaaaaaaaaa aaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaa aaaaaaa aaaa aaaaaaaaaa aaaaaaa aaaaaaaaa aaaaaaaaa & 20 & \\
    aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaa aaaaaaa aaaa aaaaaaaaaa aaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaa aaaaaaa aaaa aaaaaaaaaa aaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaa aaaaaaa aaaa aaaaaaaaaa aaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaa aaaaaaa aaaa aaaaaaaaaa aaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaa aaaaaaa aaaa aaaaaaaaaa aaaaaaa aaaaaaaaa aaaaaaaaa & 20 & \\
    aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaa aaaaaaa aaaa aaaaaaaaaa aaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaa aaaaaaa aaaa aaaaaaaaaa aaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaa aaaaaaa aaaa aaaaaaaaaa aaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaa aaaaaaa aaaa aaaaaaaaaa aaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaa aaaaaaa aaaa aaaaaaaaaa aaaaaaa aaaaaaaaa aaaaaaaaa & 20 & \\
    aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaa aaaaaaa aaaa aaaaaaaaaa aaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaa aaaaaaa aaaa aaaaaaaaaa aaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaa aaaaaaa aaaa aaaaaaaaaa aaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaa aaaaaaa aaaa aaaaaaaaaa aaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaa aaaaaaa aaaa aaaaaaaaaa aaaaaaa aaaaaaaaa aaaaaaaaa & 20 & \\
    aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaa aaaaaaa aaaa aaaaaaaaaa aaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaa aaaaaaa aaaa aaaaaaaaaa aaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaa aaaaaaa aaaa aaaaaaaaaa aaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaa aaaaaaa aaaa aaaaaaaaaa aaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaa aaaaaaa aaaa aaaaaaaaaa aaaaaaa aaaaaaaaa aaaaaaaaa & 20 & \\
    aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaa aaaaaaa aaaa aaaaaaaaaa aaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaa aaaaaaa aaaa aaaaaaaaaa aaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaa aaaaaaa aaaa aaaaaaaaaa aaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaa aaaaaaa aaaa aaaaaaaaaa aaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaa aaaaaaa aaaa aaaaaaaaaa aaaaaaa aaaaaaaaa aaaaaaaaa & 20 & \\
    aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaa aaaaaaa aaaa aaaaaaaaaa aaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaa aaaaaaa aaaa aaaaaaaaaa aaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaa aaaaaaa aaaa aaaaaaaaaa aaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaa aaaaaaa aaaa aaaaaaaaaa aaaaaaa aaaaaaaaa aaaaaaaaa & aaa aaaaaaaaaaaaaa aaaaaaaaa aaa aaaaaaaaaaaa aaaaaaa aaaa aaaaaaaaaa aaaaaaa aaaaaaaaa aaaaaaaaa & 20 & \\
\bottomrule
\end{tabularx}
\end{landscape}

\end{document} 

enter image description here

  • This solution has the same issues as the one above: it would be great if the column width would adjust to the amount of text it contains, in order for columns with more text to be wider; or if there was a way to adjust this manually. Also, I need the vertical lines because there is a din standard that says that they should be there, but soemtimes, they just stop before reaching the bottom line of the table. Can this be fixed somehow? – LizzAlice May 12 '17 at 9:15
  • Concerning the 2nd point, the vertical lines, I didn't notice it because of showframe. I've fixed it (it was due to the ,\` before \hline` is the description of \endfoot. For the 1st point, it would be easier to explain how to change the width of X columns from a real example. The present texts are all the same. – Bernard May 12 '17 at 11:01

Not the answer you're looking for? Browse other questions tagged or ask your own question.