I have a small problem in my table editing using booktabs and colors. The main problem is the background color of a cell is longer than the midrule, which is not a huge problem but it is quite annoying to look at.
I use midrules, toprules and bottomrules. A row of the table is given as:
XXXXXX & xx\% & xx\% & xx\% & xx\% & \cellcolor[HTML]{CAFFCA}xx\% & \cellcolor[HTML]{CAFFCA}xx\% & \cellcolor[HTML]{CAFFCA}xx\% \\
I'm not sure how to extend the rules or how to shorten the color. Any advice is welcome.
Minimum working code:
\documentclass{article}
\usepackage{booktabs}
\usepackage[table,xcdraw]{xcolor}
\usepackage{multirow}
\usepackage{adjustbox}
\begin{document}
\begin{table}
\centering
\footnotesize
\begin{tabular}{@{}l|rrrr@{}}
\toprule
\multicolumn{1}{c|}{\textbf{xx}} & \multicolumn{1}{c|}{\textbf{xx}} & \multicolumn{1}{c|}{\textbf{xx}} & \multicolumn{1}{c}{\textbf{xx}} & \multicolumn{1}{c}{\textbf{xx}} \\ \midrule
xx & xx & xx & xx & \cellcolor[HTML]{FE0000}xx \\
xx & xx & xx & xx & \cellcolor[HTML]{34FF34}xx \\ \bottomrule
\end{tabular}
\end{table}
\end{document}
@{}
in your column specification in order to remove horizonal white space at the right of your last table column, you might be interested in Color overshoots when using \cellcolor without intercolumn space