How to render a double bottom border on a single table cell? In the example table,
\begin{table}[htbp]
\begin{tabular}{|l|r|r|}
\hline
Item & Sales & Total \\ \hline
Item 1 & 10 & \\ \hline
Item 1 & 10 & 20 \\ \hline
Item 1 & 10 & \\ \hline
Item 2 & 10 & \\ \hline
Item 2 & 10 & 30 \\ \hline
\end{tabular}
\end{table}
I would like to place a double border under the cells containing 20 and 30 to delimit a group sub total?
Best Answer
Typically one could use
hhline
to modify the horizontal rule within atabular
, allowing a mixture of single and double lines. However, the output in your case is not very desirable. Here's an alternative, showing a modified version of your input (usingbooktabs
) first with\hhline
and then without (and some other tricks):The second option inserts a regular
\hline
followed by a1pt
gap and\cline{3-3}
(modify1pt
for a different gap). More specifically,\dimexpr
allows for an expression of dimensions, jumping back (vertically upward) a full baseline skip (-\normalbaselineskip
) and then forward (vertically downward) the default width of the rule (\arrayrulewidth
, typically0.4pt
) plus1pt
.I'm sure another technique would also suffice; this just seemed the most straight forward. This is mainly based on style, so there are other options as well.
The later option needs some additional hacking when using vertical borders also,