I have used \begin{tabularx}
or \begin{tabular*}
but neither of these two work, these two environment managed to increase the width of the table as the same as the text, while they cannot let the column contents inside the table increased associated with the table width.
[Tex/LaTex] latex how to make table as the same width as the textwidth
tableswidth
Best Answer
The
tabular*
environment is able only to act on the intercolumn space, whiletabularx
can decide the width of the columns via the column specifierX
. If one uses the latter environment withoutX
columns, no automatic enlargement will happen.Suppose you have three columns, with the first listing the items, the second with descriptions and the third with comments; we want that the latter two enlarge proportionally to the desired table width
(I've used the rules provided by the booktabs package). Put the environment inside a
table
environment with\centering
and you're done. It's also possible to haveX
columns of different width, a method is explained in the manual oftabularx
. There's also the tabu package, that should be able to manage this kind of tables.