texblog

Equal cell width in LaTeX tables

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:

\documentclass[11pt]{article}
\begin{document}
\begin{table}[ht]
\caption{Table with equal cell width.}
\begin{center}
\begin{tabular}{p{1cm}|p{1cm}}
\hline
a&bbb\\
\hline
a&bbb\\
a&bbb\\
\hline
\end{tabular}
\end{center}
\end{table}
\end{document}

Exit mobile version