How to trim \toprule
(from booktabs
package)?
It is probably something basic I'm missing, but I need it and it's nowhere to be found.
booktabsrulestables
How to trim \toprule
(from booktabs
package)?
It is probably something basic I'm missing, but I need it and it's nowhere to be found.
Best Answer
If I understand your objective correctly, you want the lines generated by
\toprule
-- and by\midrule
and\bottomrule
too, right? -- start at the left-hand edge and end at the right-hand edge of the contents of the table.To achieve this objective, you could specify
@{}
as the first and last items in the argument of atabular
,tabular*
,tabularx
, etc. environment:The MWE also illustrates that if your table has
\multicolumn
directives that encompass the first or final columns of the table, you'll again need to supply@{}
items, as appropriate, this time in the second argument of the\multicolumn
command.By the way, I believe that suppressing the whitespace at the far left and far right edges of a table is something that the author of the
booktabs
package recommends doing; see, e.g., thetabular
environment at the top of page 5 of the package's user guide; the output of that code is shown on p. 2 of the guide.