I am writing a table with colored rows using the tabu
package (2.10
). For example
\documentclass[12pt]{article}
\usepackage{tabu}
\usepackage[table]{xcolor}
\begin{document}
\begin{table}
\rowcolors{2}{red}{blue}
\begin{tabu}{cc}
\toprule
Row1 & A \\
Row2 & B \\
Row3 & C \\
\bottomrule
\end{tabu}
\end{table}
\end{document}
I have also tried with \taburowcolors 2{red ... blue}
but the colors never show up at all.
I am aware of the issue at the github repo https://github.com/tabu-fixed/tabu/issues and even after manually updating to the 2.10
release, the problem still persists for me.
Does anyone know if the problem has been fixed? If so, how can I get the colored table.
It is worth to mention that I am using the tabu
enviroment as I will be using the columns with custom lengths X[n]
. Is there any other alternative to tabu
where I can set up the length of the columns?
Best Answer
like this?
Why not use
tabu
package is explained in comments below your question ...Solution can be use
tabularx
instead oftabu
andboldline
for horizontal lines with adjusted thickness (insteadbooktabs
rules, which have (white) space above/below rule):