1
\begin{table}[ht]
\centering
\begin{tabular}{c|ccccccc}
\hline
& col1 & col2 & col3 & col4 & col5 & col6 & col7 \\
\hline
\rowcolor{red}
row1& \ra & \ra & \ra & \ra & \ra & \ra & \ra \\
row2& \ra & \ra & \ra & \ra & \ra & \ra & \ra \\
\rowcolor{red}
row3& \ra & \ra & \ra & \ra & \ra & \ra & \ra \\
row4& \ra & \ra & \ra & \ra & \ra & \ra & \ra \\
\rowcolor{red}
row5& \ra & \ra & \ra & \ra & \ra & \ra & \ra \\
row6& \ra & \ra & \ra & \ra & \ra & \ra & \ra \\
\hline
\end{tabular}
\end{table}

I have a simple table with color coded rows (red or black), and I would like to append a simple color coded legend that tells the reader Red = Male, Black = Female. Perhaps something that looks like this?

enter image description here

1

1 Answer 1

7

For example like this:

enter image description here

\documentclass[border=5mm]{standalone}
\usepackage{amssymb}
\usepackage{xcolor}
\begin{document}
\fbox{\begin{tabular}{ll}
\textcolor{red}{$\blacksquare$} & Male \\
$\blacksquare$ & Female 
\end{tabular}}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .