I am attempting to use tabular* to generate a table as I would like to also use the midrule, bottomrule etc. in order to get the different line thicknesses. However, in my attempt below, as I also try to color sections of the table, I get spaces in the color like this:
I have looked at these related solutions but wanted to know if there is a simpler solution to use here as I am still not getting my desired result.
This is my code:
\documentclass{article}
\usepackage{float}
\usepackage{xcolor,colortbl,tabularx}
\usepackage{bigstrut}
\definecolor{LightGray}{gray}{0.9}
\begin{document}
\begin{table}[H]
\centering
\caption{Not too good looking table here.\label{tab:table1}}
\footnotesize
% Table generated by Excel2LaTeX from sheet 'Sheet2'
\begin{tabularx}{\textwidth}{c @{\extracolsep{\fill}} c|ccc}
%\begin{tabular}{cc|cc}
%\toprule
\hline
\multicolumn{2}{c|}{\textbf{Test1}} & \multicolumn{2}{c}{\textbf{Test2}} \bigstrut[t]\
Test11 & Test12 & Test13 & Test14 \bigstrut[b]\
%\midrule
\hline
FLTR2 & 2 & 40 & FLTR0 \bigstrut[t]\
FLTR0 & 80 & 80 & FLTR0 \
\rowcolor[rgb]{ 1, .78, .808} \textcolor[rgb]{ .612, 0, .024}{FLTR0} & \textcolor[rgb]{ .612, 0, .024}{160} & \textcolor[rgb]{ .612, 0, .024}{204} & \textcolor[rgb]{ .612, 0, .024}{FLTR4} \
FLTR6 & 6 & 44 & FLTR4 \
\rowcolor[rgb]{ 1, .78, .808} \textcolor[rgb]{ .612, 0, .024}{FLTR16} & \textcolor[rgb]{ .612, 0, .024}{16} & \cellcolor[rgb]{ 1, 1, 1}43 & \cellcolor[rgb]{ 1, 1, 1}FLTR3 \
FLTR4 & 44 & 6 & FLTR6 \bigstrut[b]\
\hline
%\bottomrule
\end{tabularx}%
%\end{tabular}
\end{table}
\end{document}
How to get the color to fill the cells without any gaps and at the same time use the toprule, midrule etc?






colortblreally doesn't want to colour the inter-column spaces produced bytabular*if you really want to stretch the table, you could look at newer packages such as nicematrix or tabularray that use different mechaisms to add the coloured panels. β David Carlisle Oct 15 '22 at 16:52