Graphics, Figures & TablesHelp choosing the right table strategy

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
ulula
Posts: 5
Joined: Fri Mar 19, 2010 6:18 pm

Help choosing the right table strategy

Post by ulula »

I am generating LaTeX code from another program. Basically my script finds tables and it gets the width of the entire table. Now, in the source program (DOORS) however, perhaps users have not always adjusted their tables, maybe they took just the default size for every cell. This makes my total width a large number, which of course makes it into the LaTeX code, which then looks funny in the document. I was wondering if, despite the width property in the following code, there was a way to get the columns to adjust to the cell contents so that it would be less than 787.5 width:

Code: Select all

\begin{tabularx}
	{787.5pt}{X X X X } \toprule label 1 & label 2 & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas ipsum nisl, pulvinar ac facilisis sed, blandit fermentum leo. Praesent gravida, orci eu porta iaculis, & Lorem rhoncus eleifend 4 \\
	\midrule item 1 & Lorem ipsum & item 3 & item 4 \\
	\bottomrule 
\end{tabularx}
If not, I suspect my only option is to correct the source i.e. have users fix their tables so they look the way they would like to see them.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Post Reply