4

I'm trying to get table formated like this:

A    desription of A      D    description of D
B    long description     Eee  description of Eee
     of B                 F    description of F
Cccc description of Cccc  

and I'm limited with space on the page where this table should be.

When I use \begin{tabular}{lp{5cm}lp{5cm}} I get table which is too long to fit onto the page, longtable with same parameters throws last line onto next page.

With multicols package I tried tabbing environment, but long description of B goes over Eee and longtable throws error that it can t be used in twocolumn. description environment can do that sort of things but I can't force it to align descriptions

Is there chance to make this table automatically without experimenting with \\positioning or creating two independent tables?

1
  • You can use the package ltxtable with the column X. Jun 2, 2011 at 10:52

2 Answers 2

3

You could use a description environment, it works in twocolumn mode as well and matches the original meaning.

\documentclass{article}
\begin{document}
\twocolumn
\begin{description}
  \item[A] description of A
  \item[B] long description of B
  ...
\end{description}
\end{document}

There are packages such as enumitem and mdwlist which provide tools for customizing the layout of the description list, so you don't have to use the default layout but can make it look like a table.

2
  • Thanks for fast and accurate answer. I've added the code I used. It works exactly as I want.
    – Crowley
    Jun 2, 2011 at 11:33
  • @Crowley there's no need to put the solution back into the question. Stefan's answer, and your having accepted it will suffice.
    – Alan Munn
    Jun 2, 2011 at 11:51
2

You may try tabularx from the tabularx package

\begin{tabularx}{\columnwidth}{@{}lXlX@{}}

I've used @{} at left and right to give the table maximum room.

2
  • The first suggestion is fitting tabular ultimately into width of paper but it doesn't spare the blank space forced by long description of D. And tabularx inside 'multicols' doesn't break into the second column - it overflows off the page.
    – Crowley
    Jun 2, 2011 at 11:19
  • @Crowley: my first suggestion was actually wrong. Wide tables in two column format should be avoided, as they are likely to give problems. A tabularx is like tabular and can't be broken.
    – egreg
    Jun 2, 2011 at 11:36

You must log in to answer this question.

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