I have a series of tables that are going to be very (very!) wide, but with only 3 rows. Is there any way I can get the tables to wrap within my margins, without having to break the rows within the .tex file itself?

  • Welcome to TeX.sx No need to addd thanks, simply upvote good answers to your Q that you receive. – Peter Jansson Feb 7 '13 at 20:14
  • Please provide a bit more information about the tables' structure. E.g., how many columns do they contain, and what is the content of each cell: Simple integers, decimal numbers, text, images, or a mixture of all of the above? – Mico Feb 7 '13 at 20:15
  • 1
    Outside-of-the-box answer: You could flip the orientation of the table and make it a three-column table that wraps vertically .In order to make better use of the horizontal space then, you could use a multicols environment from the multicol package. Let me know if that’s an option, I can add a sample. – doncherry Feb 7 '13 at 20:24

enter image description here


{\def\endarray{\crcr \egroup
 \egroup \@arrayright \gdef\@preamble{}}%
\global\setbox1\hbox{\unhbox1 \unskip\global\setbox7\lastbox}%
\global\setbox3\hbox{\unhbox3 \unskip\global\setbox9\lastbox}%
\global\setbox5\hbox{\unhbox5 \unskip\global\setbox\zz\lastbox}%



  • Works great, but this breaks the use of \hline it seems. Is there any other way with this macro to make a horizontal line? Or a different solution which does allow horizontal lines? – PHPirate Jan 1 '18 at 16:31
  • best not to ask a question on a comment on such an old answer, you could ask a new question referencing this, I'm not sure if I can guess how you would want horizontal lines to work if the cells are wrapping. So a new question would give you space to make a clearer example @PHPirate – David Carlisle Jan 1 '18 at 17:01
  • Yeah sorry my bad, will do. – PHPirate Jan 1 '18 at 17:02

Not easily. But there are ways around this, to avoid duplicating your table structure (and promote consistency). The example below uses the idea from Easiest way to delete a column? to selectively hide certain columns in a table:

enter image description here

\usepackage{array,tabularx}% http://ctan.org/pkg/{array,tabularx}
  one & two & three & four & five & six & seven & eight & nine & ten \\
  1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10
\setlength{\parindent}{0pt}% Just for this example







You would store the contents of the table in a macro (say \mywidetable) and then create a table-setting macro \insertmywidetable. The latter takes an argument for the column specification, where you selectively use H to hide that particular column, or something else (X if using tabularx, say, or c, or...).

Two examples are shown, first using a traditional tabular with c-columns, then using a tabularx with X-columns.

  • Starting an answer with "No" That's just setting a challenge:-) – David Carlisle Feb 7 '13 at 21:16
  • @DavidCarlisle: Well well, and you rose to the occasion. I'll keep my inferior attempt at showing authority with an edit... :-| – Werner Feb 7 '13 at 21:18
  • actually I forgot to +1 yours (done now) It's probably more robust if you want to use tabularx or fancy inter-column rules or something. – David Carlisle Feb 7 '13 at 21:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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