Latex will automatically adjust the width of a cell in a table. If you wish to have a table where each cell in a row has the same width, you would use the p option instead of l, c or r for left, centre or right alignment.
Example:
\begin{table}[ht]
\centering
\begin{tabular}{|p{1cm}|p{1cm}|}
\hline
a&bbb\\
\hline
a&bbb\\
a&bbb\\
\hline
\end{tabular}
\end{table}
May 7, 2008 at 5:31 pm |
This is true, but the p{} command implies left alignment.
What if you want a fixed width column _and_ center (or right) alignment?
May 7, 2008 at 9:49 pm |
[...] Fwd: Equal cell width right and centre aligned content One of my last posts was on how to define the width of a column in a table (see here). [...]
May 7, 2008 at 10:03 pm |
Hi Dector,
Thanks for your comment, you are perfectly right. As this is not an easy thing to do and it is best explained with some pieces of latex code, let me write a new post on that issue.
Hope you don’t mind,
Tom
September 15, 2008 at 9:10 am |
Hi,
I found a round-about way. I used {c c c c} but for the first row I inserted \hspace {1cm} on either side of each entry. This way I could introduce space as much I wished to, and also had the text centered. Once done for the first row u do not need to repeat it for the following rows.
November 25, 2008 at 9:29 pm |
Hi,
I was wondering, is there was a way to define an overall table width without affect text sizes? Any info would help immensely, thanks!
December 16, 2008 at 10:42 pm |
Hey Jackie,
If I understand your question correctly, you can use a fixed cell width to produce a fixed table width, where the text size will not influence the size as described in the post.
Ok?
Tom.
March 30, 2009 at 9:59 am |
Cool! Thank you very much