Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I found the following post to change the font color of a single row in a table:

How to color the font of a single row in a table?

My row is a long table with 70 rows and for about 25 the I want to change the font color. I was wondering if there is a better way of coloring these 25 rows rather than using \rowfont{\color{red}} 25 times?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

enter image description here

\documentclass{article}

\usepackage{color,array}

\makeatletter


\def\zapcolorreset{\let\reset@color\relax\ignorespaces}
\def\colorrows#1{\noalign{\aftergroup\zapcolorreset#1}\ignorespaces}

\makeatother

\begin{document}

\begin{tabular}{ll}
1&2\\
1&2\\
1&2\\\colorrows{\color{red}}
1&2\\
1&2\\
1&2\\\colorrows{\color{black}}
1&2\\
1&2\\
1&2
\end{tabular}
\end{document}
share|improve this answer
    
Create solution! thanks! –  Josh Feb 6 '13 at 12:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.