I'd like to color the rows of a table to make it easy readable. Some cells have multiple lines, so I use the makecell package, and planned to use the xcolor for coloring, but they are clashing. Sample code:
\documentclass{article}
\usepackage{makecell}
%\usepackage[table]{xcolor}
\usepackage{bpchem}
\begin{document}
%\rowcolors[1]{gray!25}{white}
\begin{tabular}{ccc}
\BPChem{H\_2O}&\BPChem{H\_3N}&\BPChem{H\_4C}\\
\makecell{\BPChem{H\_2O\_2}\\unstable}&\BPChem{H\_4N\_2}&\BPChem{H\_6C\_2}\\
not exists&\makecell{\BPChem{H\_5N\_3}\\unstable}&\BPChem{H\_8C\_3}\\
\end{tabular}
\end{document}
Best Answer
The
\rowcolors
command needs 3 mandatory arguments. As I don't havebpchem
installed, I loadedchemformula
, which anyway has a simpler syntax for compounds. I took the liberty to change the shade of grey for a nicer one, and added some vertical padding at the top of rows: