LyXTable Column Widths

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
samstevens
Posts: 1
Joined: Mon Nov 30, 2009 8:43 pm

Table Column Widths

Post by samstevens »

Dear Community

I am making some tables for a document (report class with customised margins). I set the widths of individual columns by right clicking on them and settings/table and settings/width and changing the value to whatever I wish. Regardless of whether I set the value in inches, mm, % of page etc, there is a really strange trend I have noticed:

A column of 2x (where x is any number) is always less wide than 2 columns of width x. Does this make sense?

Furthermore, the workable space on my document is 6 inches, as confirmed by the width I have set for my graphics which work fine, however a table of 1 column needs have that column at around 5.835 inches in order to produce a 6 inch column in the PDF, AND tables of two columnsor more will produce tables wider than 6 inches despite each value of the individual columns totalling 5.835 inches.

I would like to know what is going on so I can create tables that are all the same width regardless of how many columns each individual table has.

Any ideas?

I am using the latest version of LyX and Snow Leopard.

Thank you in advance.

Sam

Recommended reading 2024:

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

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

fatra2
Posts: 126
Joined: Fri May 01, 2009 1:43 pm

Table Column Widths

Post by fatra2 »

Hi there,

Don't know anything about clicking and right-clicking in LaTeX, so I can help with a solution that involves a cool device (the keyboard). OK, enough of that.

A table, in LaTeX is created with the "tabular" environment. You need to, from the source code file, write:

Code: Select all

\begin{tabular}{|p{6in}|p{6in}|}\hline
the value in the first column & the value in the second column \\ \hline
the second value in the first column & the second value in the second column \\ \hline
\end{\tabular}
This will create a two column table of 6 inches wide each. The values are entered in paragraph environment. The values of each cell is separated by a vertical line and a horizontal line.

Hope this helps. Cheers
Post Reply