I'm trying to create a colored table with something like this code:
\documentclass[a4paper,twoside]{book}
\usepackage{amsmath}
\usepackage{color}
\usepackage{tabularx}
\usepackage{colortbl}
\pagestyle{empty}
\definecolor{lightblue}{cmyk}{0.5,0,0,0}
\definecolor{lightgrey}{cmyk}{0.25,0,0.25,0}
\begin{document}
\begin{tabularx}{\textwidth}{|X|X|}
\hline
\rowcolor{lightblue}
Item 1 & Item 2 \\
\rowcolor{lightgrey}
$$A=\left(\begin{smallmatrix}0&0&0\\0&0&0\end{smallmatrix}\right)$$ &
$$B=\left(\begin{smallmatrix}1&1&1\\1&1&1\end{smallmatrix}\right)$$ \\
\hline
\end{tabularx}
\end{document}
But in the second row the first cell is completely black! Why?.
I tried to change smallmatrix
to matrix
but then the cell shows a little black box. I don't understand nothing!
$$
but single$
for cells.$$
is for display math and greats a paragraph. It should be anyway not be used in modern LaTeX documents, but\[
..\]
instead.array
like environments