LaTeX forum ⇒ Graphics, Figures & TablesDistribute width of 3 column table evenly Topic is solved

Information and discussion about graphics, figures & tables in LaTeX documents.
bgreen
Posts: 23
Joined: Wed Nov 22, 2023 11:02 am

Distribute width of 3 column table evenly

Postby bgreen » Thu Apr 11, 2024 2:13 am

Hello,

I have found my first foray into tables a challenge. I'm hoping for advice on what hopefully is a simple task. Below is a 3 column table. I want the the three columns to have the same width. Any assistance is appreciated.


\documentclass{article}
\usepackage{hyperref}
\usepackage{tabulary,booktabs}
\setlength{\belowcaptionskip}{1ex}
\begin{document}

\begin{table}[hbp!]
\caption{Board Specifications. \label{tabLabel}}
\footnotesize    
\begin{tabulary}{\linewidth}{@{}lLL@{}}\toprule
Parameter & 4'6" 3-fin Bonzer & 5'0" 5-fin Bonzer  \\\midrule
Widest point      & 21-1/2"     & 21-1/2" \\
Nose             & 20-1/4"     & 20-1/4" \\
Tail             & 20-1/8"     & 20"     \\
Tailblock(pod)   & 16-3/4"     & 17"     \\
Thickness        & 1-1/2 to 1-11/16th" max  & 1-1/2 to 1-11/16th" max   \\
Center fin (fin box)  & 6-inch True Ames Bonzer center fin     & 6-inch True Ames Bonzer center fin \\
Bonzer keel runner side fins (glassed on) & 10-inch length at base x 2-1/2 inch high trailing edge & Front fins: 5-1/2 inch base x 2 inch trailing edge
Aft fins: 6 inch base x 2-1/2 inch trailing edge
\\
 \\\bottomrule
\end{tabulary}
\end{table}
\end{document}

Recommended reading 2021:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics
bgreen
Posts: 23
Joined: Wed Nov 22, 2023 11:02 am

Distribute width of 3 column table evenly

Postby bgreen » Thu Apr 11, 2024 6:32 am

Oddly, when I compiled this code in a small file, the columns were not evenly distributed.

When I copied the code into a much larger document, it compiled as I hoped.

For my learning, any advice on enhancing the code I supplied, would be helpful.

User avatar
Stefan Kottwitz
Site Admin
Posts: 10176
Joined: Mon Mar 10, 2008 9:44 pm

Distribute width of 3 column table evenly  Topic is solved

Postby Stefan Kottwitz » Thu Apr 11, 2024 2:57 pm

I recommend to use tabularx instead of tabulary:

\documentclass{article}
\usepackage{hyperref}
\usepackage{tabularx,booktabs}
\setlength{\belowcaptionskip}{1ex}
\begin{document}

\begin{table}[hbp!]
\caption{Board Specifications. \label{tabLabel}}
\footnotesize    
\begin{tabularx}{\linewidth}{@{}XXX@{}}\toprule
Parameter & 4'6" 3-fin Bonzer & 5'0" 5-fin Bonzer  \\\midrule
Widest point      & 21-1/2"     & 21-1/2" \\
Nose             & 20-1/4"     & 20-1/4" \\
Tail             & 20-1/8"     & 20"     \\
Tailblock(pod)   & 16-3/4"     & 17"     \\
Thickness        & 1-1/2 to 1-11/16th" max  & 1-1/2 to 1-11/16th" max   \\
Center fin (fin box)  & 6-inch True Ames Bonzer center fin     & 6-inch True Ames Bonzer center fin \\
Bonzer keel runner side fins (glassed on) & 10-inch length at base x 2-1/2 inch high trailing edge & Front fins: 5-1/2 inch base x 2 inch trailing edge
Aft fins: 6 inch base x 2-1/2 inch trailing edge
\\
 \\\bottomrule
\end{tabularx}
\end{table}
\end{document}


tabularx distributes the widths evenly, while tabulary makes it proportional to the natural with of the widest item in a column.

Szefan
LaTeX.org admin


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 16 guests