Below is my code. How do I add a background colour to the first row (only the first row, please)?
\begin{table}[!htb]
\centering
\begin{tabular}{c c c}
\toprule
\textbf{Temperature} [K] & \textbf{Thickness}$[\mu m]$ & \textbf{Permittivity}\\
\midrule
$H \# /k$ & K & 17762 \\
\bottomrule
\end{tabular}
Best Answer
You can't use
booktabs
with coloured rows as it introduces some vertical spaces around horizontal rules, which will not be coloured. Instead I suggest using\boldline
, a small package from theshipunov
bundle, which allows forhline
s withvariable thickness
. The syntax is\hlineB{number}
(or\clineB
), which will draw a horizontal line with thickness equal tonumber × \arrayrulewidth
.To replace the vertical spacing added by
booktabs
, you can use thecellspace
package, which can add some minimal vertical padding at the top and bottom of cells.