• You can always define your own color and use it to color columns. Here is an example:

\documentclass[11pt]{article}
\usepackage{colortbl}
\begin{document}
\definecolor{lightblue}{rgb}{0.53,0.8,0.98}
\newcolumntype{C}{&gt;{\columncolor{lightblue}}c}
\begin{table}[ht]
\caption{default}
\begin{center}
\begin{tabular}{|C|C|}
\hline
a&amp;a\\
b&amp;b\\
\hline
\end{tabular}
\end{center}
\label{default}
\end{table}
\end{document}

Cheers, Tom.

1. Nikos Alexandris

Thanks for the Addendum, Nikos

2. Christiaan Pauw

Sometimes the last row contains totals etc. and one does not want to color that but separate it with a libne from the rest of the table: How is that done?

• Hi Christiaan,

You could always overwrite the color using \rowcolor on the last row.

\documentclass[11pt]{article}
\usepackage[table]{xcolor}
\definecolor{lightgray}{gray}{0.9}
\begin{document}
\begin{table}[ht]
\caption{Current month expenses}
\begin{center}
\rowcolors{1}{}{lightgray}
\begin{tabular}{lr}
\hline
Expenses &amp; Amount\\
\hline
Movies &amp; 20 \\
Shopping &amp; 50 \\
Groceries &amp; 80 \\
Other &amp; 50 \\
\hline\hline
\rowcolor{white}
Total&amp;200\\\hline
\end{tabular}
\end{center}
\end{table}
\end{document}
• Thanks for the link, wasn’t aware of that discussion :-).

3. S.Karim

Hi tom,,,
how can we define the width of \hline ? mean bold etc,
secondly, if we to produce a dotted line (……..) or (_ _ _ _ _), etc, can this be done via \hline command???
thanks.

4. S.Karim

thanks tom, good article…… 🙂
cheers.

5. Julien Gamba

Hi, thanks for your article. I think there is a typo in the addendum, don’t you want to load the xcolor package instead of color? The color package does not have a table option. It works well with the xcolor package though.

• tom

Hi Julien,

Thanks for the correction, it is fixed now.

Best, Tom