I'm making a table in latex with the booktabs package. I would like some of the…
- User
I'm making a table in latex with the booktabs package. I would like some of the horizontal lines from midrule to only go partway across the table. For example if the table has 12 columns I might like one of the midrules to only go across 6 of them.
Assistant
You can use
\cmidrule(column mid-rule) from the booktabs package to create partial horizontal lines. Here's how to use it:\cmidrule{start-end}Where
startandendare the column numbers you want the rule to span.For your example with a 12-column table where you want a rule across only 6 columns:
\begin{tabular}{cccccccccccc} \toprule A & B & C & D & E & F & G & H & I & J & K & L \\ \midrule 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 \\ \cmidrule{1-6} % Rule from column 1 to 6 a & b & c & d & e & f & g & h & i & j & k & l \\ \bottomrule \end{tabular}
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.