Tuesday, March 16, 2010

Adding alternate-row shading to your LaTeX Tables

Two steps,

  1. In the preamble:

    \documentclass{article}

    \usepackage[table]{xcolor}
    \definecolor{tableShade1}{HTML}{F1F5FA}
    \definecolor{tableShade2}{HTML}{ECF3FE}

    \begin{document}

  2. Just before \begin{tabular}, add

    \rowcolors{1}{tableShade1}{tableShade2}

    The first argument is which row to start on. This is useful (e.g.) if your header row is actually multiple rows.


Source: http://www.cv-templates.info/2009/07/alternate-row-shading-latex/

Followers