# How do you make a table with a set width and equal intercolumn spacing?

(Note that I am NOT trying to make a table with equal column spacing.)

Here's a table with 6 columns:

\begin{tabular}{cccccc}
a&bbbbb&cccccccccc&d&eeeee&ffffffffff\\
g&hhhh&iiiiiiiii&j&kkkk&lllllllll\\
m&nnnnn&ooooooooooo&pp&qqqqq&rrrrrrrrr
\end{tabular}


The tabular environment adds some intercolumn spacing, which I can adjust manually by changing \tabcolsep. However, what I need is to be able to set a total width for the table (e.g. 4in). It would then calculate on its own what the intercolumn spacing should be, to achieve a 4-inch table. That is, the widths of each column are subtracted from the total width, and the remainder is split equally among the 5 intercolumn spaces. The columns still have different widths. Is this something that can be easily done with tabular, tabularx, or similar?

• Try \begin{tabularx}{3in}{*{3}{X} ... \end{tabularx}.. If you want the content to be centred, replace X with >{\centering\arraybackslash}X. Oct 31 '18 at 0:02

at 10pt the suggested data does not fit in a 3in table, but at \small size it does:

\documentclass{article}

\begin{document}

\rule{3in}{2pt}
\small

\begin{tabular*}{3in}{@{\extracolsep{\fill}}cccccc@{}}
a&bbbbb&cccccccccc&d&eeeee&ffffffffff\\
g&hhhh&iiiiiiiii&j&kkkk&lllllllll\\
m&nnnnn&ooooooooooo&pp&qqqqq&rrrrrrrrr
\end{tabular*}
\end{document}

• That's a fair critique--I just changed it to 4 inches. Oct 31 '18 at 0:24