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.

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?

share|improve this question
    
You can use the package ltxtable with the column X. –  Marco Daniel Jun 2 '11 at 10:52

2 Answers 2

up vote 2 down vote accepted

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.

share|improve this answer
    
Thanks for fast and accurate answer. I've added the code I used. It works exactly as I want. –  Crowley Jun 2 '11 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 '11 at 11:51

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.

share|improve this answer
    
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 '11 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 '11 at 11:36

Your Answer

 
discard

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.