I would like to color the text containing in the table row but with different colors in each row. How can I do this? Below, I show my minimum code.
\documentclass[12pt, article]{memoir}
% Packages
\usepackage[T1]{fontenc}
\usepackage[brazilian]{babel}
\usepackage{geometry}
\geometry{a4paper, hdivide = {30mm, 160mm, 20mm}, vdivide = {30mm, 247mm, 20mm}}
\usepackage{xltabular}
\usepackage{multirow}
\usepackage{bigstrut}
\usepackage{booktabs}
\usepackage{graphicx}
\graphicspath{{../imagens/}}
\usepackage[table]{xcolor}
% First row in table one
\def\mil{\rotatebox{90}{Millions}}
\def\hth{\rotatebox{90}{Hundred thousands}}
\def\tth{\rotatebox{90}{Ten thousands}}
\def\tho{\rotatebox{90}{Thousands}}
\def\hun{\rotatebox{90}{Hundreds}}
\def\one{\rotatebox{90}{Ones}}
\def\pnt{\rotatebox{90}{and}}
\def\ten{\rotatebox{90}{Tenths}}
\def\hus{\rotatebox{90}{Hundredths}}
\def\ths{\rotatebox{90}{Thousandths}}
\def\tts{\rotatebox{90}{Ten thousandths}}
\def\hts{\rotatebox{90}{Hundred thousandths}}
\def\mls{\rotatebox{90}{Millionths}}
\def\tms{\rotatebox{90}{Ten millionths}}
\def\hms{\rotatebox{90}{Hundred millionths}}
\begin{document}
\begin{xltabular}{\linewidth}{ccccccccccccccccccccc}
\toprule
\mil & \hth & \tth & \tho & \hun & \one & \pnt & \ten & \hus & \ths & \tts & \hts & \mls & \tms & \hms &&&&& \
\midrule\rowcolor{blue}
& & & & 3 & 6 & . & 5 & 7 & & & & & & & & & & & \
\midrule%\rowstyle{\color{green}}
\multicolumn{15}{c}{thirty-six and fifty-seven hundredths.}\
\midrule
& & & & & 4 & . & 6 & 0 & 3 & & & & & & & & & & \
\midrule
\multicolumn{15}{c}{four and six hundred three thousandths}\
\midrule
& & & 1 & 2 & 4 & . & 1 & 2 & 3 & & & & & & & & & & \
\midrule
\multicolumn{16}{c}{One hundred twenty four and one hundred twenty three thousandths}\
\midrule
& & & & 1 & 2 & . & 0 & 0 & 3 & 2 & 1 & 4 & & & & & & & \
\midrule
\multicolumn{15}{c}{Twelve three thousand two hundred fourteen millionths.}\
\midrule
& & & & & 0 & . & 3 & 2 & 6 & 3 & & & & & & & & & \
\midrule
\multicolumn{15}{c}{text}\
\bottomrule\
\end{xltabular}
\end{document}
xltabularwithout anyXtype column will not necessarily result in the expecred output. If your table is narrower than the available width, this will lead to horizontal lines continuing to the left margin and an output that looks like the last column was overly wide. You might want to adjust that. – leandriis Apr 17 '21 at 07:45xltabularfor this particular table? As it currently is, it should fit onto a single page quite easily. Will you add more rows later? Also, you declare a total of 21 columns, but actually only seem to use 15 of them. Is that intentional? – leandriis Apr 17 '21 at 07:52xltabular. Please take a closer look at the answer I liked to earlier, especially at the screenshot of the otuput. Doesn't this image show colored text as opposed to a colored background, so exactly what you seem to be interested in? Also, neither this particular answer, to which I linked to earlier, nor any of my previous comments mention the command\rowcolors. – leandriis Apr 17 '21 at 09:05