0

Here's my problem:

I want to create tables that span multiple pages. If I understood it correctly I better have to use longtable for this.

I need 6 columns and each column should be the same fixed width. (The table should span the entire page width expect for its margin)

How do I do it? Keep it simple please, I have little to no experience in working with LaTeX

1 Answer 1

1

For tables with fixed width columns I would prefer using the tabu package that offers longtabu which can spread over multiple pages.

The following MWE creates such a table. With {X[c]X[r]X[l]X[c]X[c]X[c]} you can specify the amount of colums you want to use and their format. X stands for a column that is as wide as it has to be to fill the desired width (default is textwidth). If there is more than 1 X-column, every X column gets the same width. [c], [l] and [r] are the usual possibilities to set centeres, left-aligned and right-aligned text respectively. As you can see from the example, longer entries are automatically spread over multiple lines and a caption can be added inside the longtabu environment.

\documentclass{scrreprt}

\usepackage{longtable}
\usepackage{tabu}


\begin{document}

\begin{longtabu}{X[c]X[r]X[l]X[c]X[c]X[c]}
column 1 & column 2 & column 3 & column 4 & column 5 & column 6 \\
\hline
\endhead%
a longer entry     & b     & c     & d     & e     & f \\
g     & h     & i     & j     & k     & l \\
m     & n     & o     & p     & q     & r \\
s     & t     & u     & v     & w     & x \\
a     & b     & c     & d     & e     & f \\
g     & h     & i     & j     & k     & l \\
m     & n     & o     & p     & q     & r \\
s     & t     & u     & v     & w     & x \\
a     & b     & c     & d     & e     & f \\
g     & h     & i     & j     & k     & l \\
m     & n     & o     & p     & q     & r \\
s     & t     & u     & v     & w     & x \\
a     & b     & c     & d     & e     & f \\
g     & h     & i     & j     & k     & l \\
m     & n     & o     & p     & q     & r \\
s     & t     & u     & v     & w     & x \\
a     & b     & c     & d     & e     & f \\
g     & h     & i     & j     & k     & l \\
m     & n     & o     & p     & q     & r \\
s     & t     & u     & v     & w     & x \\
a     & b     & c     & d     & e     & f \\
g     & h     & i     & j     & k     & l \\
m     & n     & o     & p     & q     & r \\
s     & t     & u     & v     & w     & x \\
a     & b     & c     & d     & e     & f \\
g     & h     & i     & j     & k     & l \\
m     & n     & o     & p     & q     & r \\
s     & t     & u     & v     & w     & x \\
a     & b     & c     & d     & e     & f \\
g     & h     & i     & j     & k     & l \\
m     & n     & o     & p     & q     & r \\
s     & t     & u     & v     & w     & x \\
a     & b     & c     & d     & e     & f \\
g     & h     & i     & j     & k     & l \\
m     & n     & o     & p     & q     & r \\
s     & t     & u     & v     & w     & x \\
a     & b     & c     & d     & e     & f \\
g     & h     & i     & j     & k     & l \\
m     & n     & o     & p     & q     & r \\
s     & t     & u     & v     & w     & x \\
a     & b     & c     & d     & e     & f \\
g     & h     & i     & j     & k     & l \\
m     & n     & o     & p     & q     & r \\
s     & t     & u     & v     & w     & x \\
a     & b     & c     & d     & e     & f \\
g     & h     & i     & j     & k     & l \\
m     & n     & o     & p     & q     & r \\
s     & t     & u     & v     & w     & x \\
a     & b     & c     & d     & e     & f \\
g     & h     & i     & j     & k     & l \\
m     & n     & o     & p     & q     & r \\
s     & t     & u     & v     & w     & x \\
\caption{caption}
\end{longtabu}%


\end{document}

For an overview of available packages for tables and a short description, please refer to this answer.

2
  • thank you, you've save me! Just one more question, why did you use scrreprt Aug 30, 2017 at 7:03
  • Well this is just the documentclass I normally use. For this mwe there is no special reason.
    – leandriis
    Aug 30, 2017 at 7:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .