How can i set the minimum width of a table? I want to have a series of tables that are all the same width?
Asked
Active
Viewed 1.2e+01k times
2 Answers
24
I would use the tabularx package. An argument to the tabularx environment specifies the table width, X columns share the available space.
A simple example:
\usepackage{tabularx}
\begin{tabularx}{.8\textwidth}{lXXr}
left column & text & text & right column
\end{tabularx}
See also:
Stefan Kottwitz
- 231,401
-
1@user1709076 It's setting the table width depending on the text width, as 80% of the current text width. – Stefan Kottwitz Oct 19 '19 at 13:18
-
is there any way to set the width of the table in inches? – user1709076 Oct 19 '19 at 13:22
-
1@user1709076 Sure, such as \begin{tabularx}{4in}{lXXr} – Stefan Kottwitz Oct 19 '19 at 13:27
12
Use a tabular* environment, with @{\extracolsep{\fill}}, as in
\begin{tabular*}{.5\linewidth}{@{\extracolsep{\fill}}ccc}
One& Two& Three\\
Four& Five& Six
\end{tabular*}
(where you replace .5\linewidth with something wide enough for all of the tables).
David Carlisle
- 757,742
Phil Hirschhorn
- 8,942