You can use the\columncolor
command, from colortbl
(loaded by the [table]
option of xcolor
). I added some padding to the cells, changing the value of \arraystretch
.
Added: A second solution, with tabularx
can fill the whole line width. \documentclass{article}
\usepackage[showframe]{geometry}
\usepackage{mathtools}
\usepackage{array, tabularx, caption}%
\usepackage[table, svgnames]{xcolor}
\begin{document}
\begin{table}[!htb]
\centering%
\renewcommand{\arraystretch}{1.6}
\caption{My table}
\begin{tabular}{|>{\centering\bfseries\columncolor{RoyalBlue!80}}m{2cm} |*{8}{m{3mm}|}}
\hline
TEXT & & & & & & & & \\ \hline
TEXT & \multicolumn{8}{l|}{} \\ \hline
TEXT & \multicolumn{8}{l|}{} \\ \hline
TEXT & \multicolumn{8}{l|}{} \\ \hline
\end{tabular}
\end{table}
\begin{table}[!htb]
\renewcommand{\arraystretch}{1.6}
\renewcommand{\tabularxcolumn}[1]{>{\arraybackslash}m{#1}}
\caption{My table}
\begin{tabularx}{\linewidth}{|>{\centering\bfseries\columncolor{RoyalBlue!80}\hsize =3\hsize}X |*{8}{ >{\hsize=0.75\hsize}X|}}
\hline
TEXT & & & & & & & & \\ \hline
TEXT & \multicolumn{8}{l|}{} \\ \hline
TEXT & \multicolumn{8}{l|}{} \\ \hline
TEXT & \multicolumn{8}{l|}{} \\ \hline
\end{tabularx}
\end{table}
\end{document}
