I want to create a table using longtable
where all columns have a fixed length except the last one, which should take all remaining space. The table itself should be full page width.
I tried the following with longtable
, but it is not working:
\documentclass{article}
\usepackage{longtable}
\usepackage{tabu}
\usepackage{array}
\usepackage{booktabs}
\setlength\parindent{0pt}
\setlength\LTleft{0pt}
\setlength\LTright{0pt}
\begin{document}
\begin{longtable}[h]{p{2cm}l@{\extracolsep{\fill}}}
\toprule
Icon & Description \\
\midrule
Icon 1 & Means this and that \\
Icon 2 & Means some other thing \\
\bottomrule
\end{longtable}
\end{document}
With tabu
I would achieve something like this as follows:
\begin{tabu} to \textwidth {p{2cm}X}
Here's an online example: https://es.sharelatex.com/project/555e01773b14e98f7d55ed84
How to do the same using longtable
?
Edit: I know I can do this with other environments. The question is specifically whether this can be achieved with longtable
.
Best Answer
You can use the
ltablex
package, which brings the functionalities oflongtable
intabularx
environments: