Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.


% Table here


I am unable to get the table to span over multiple pages while fitting the table to the width of the landscape page. Would you know how to do this, please let me know.

share|improve this question
Consider using the ltxtable package. As suggested by its slogan: "ltxtable: longtable meets tabularx" –  Werner May 3 '12 at 21:20

1 Answer 1

First off, don't use both table and longtable -- the two environments shouldn't (and mustn't) be nested. Separately, since a longtable isn't a float (in the LaTeX sense of the word), there's no point providing location directives such as [!htb].

Second, to force the width of the longtable environment to be equal to \textwidth, type something like

\setlength\LTcapwidth{\textwidth} % default: 4in (rather less than \textwidth...)
\setlength\LTleft{0pt}            % default: \parindent
\setlength\LTright{0pt}           % default: \fill
... % tabular material here

Note that the code above also resets the \LTcapwidth macro; since you're working in landscape mode, you'll almost certainly want to override this macro's default value of 4 inches. The @{\extracolsep{\fill}} directive, by the way, is exactly the same as what one would use in a tabular* environment. It tells LaTeX to insert \fill -- an infinitely stretchable amount of whitespace -- in each intercolumn space.

For more information on using the longtable environment, see the longtable user guide; if you're using TeXLive or MikTeX, the user guide may be brought up by typing texdoc longtable in a command window.

share|improve this answer
texdoc longtablealso works if you are using a MikTeX installation. –  Sveinung May 3 '12 at 21:50
@Sveinung -- good point! I'll add this piece of information. –  Mico May 3 '12 at 22:33
Which part of your code forces the width of the longtable environment to be equal to \textwidth? –  tommy.carstensen 2 days ago
@tommy.carstensen - it's the resetting of the length parameters \LTleft and \LTright, along with the insertion of the directive @{\extracolsep{\fill}} at the start of the longtable environment. –  Mico 2 days ago
It still exceeds the page width here. I'm probably doing something wrong. I'm new to tex. I'll keep looking for a solution. –  tommy.carstensen 2 days ago

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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