GeneralSetting text (not background) color for an entire table row?

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
oddhack
Posts: 3
Joined: Tue Nov 04, 2008 11:50 am

Setting text (not background) color for an entire table row?

Post by oddhack »

Is there any equivalent to \rowcolor that will let me set the text color for an entire table row with a single command? It gets awfully tedious to type

Code: Select all

    \color{blah} field1 & \color{blah} field2 & ... \color{blah} fieldN \\
but I haven't found any way to scope \color at the entire row level.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
Annabel
Posts: 14
Joined: Mon Jun 16, 2008 3:21 pm

Setting text (not background) color for an entire table row?

Post by Annabel »

I guess the colortbl package is the right one for you:

http://www.ctan.org/tex-archive/macros/ ... /colortbl/
oddhack
Posts: 3
Joined: Tue Nov 04, 2008 11:50 am

Setting text (not background) color for an entire table row?

Post by oddhack »

Annabel wrote:I guess the colortbl package is the right one for you:
Thanks, but could you be more specific as to what part of colortbl? I don't see any commands in there that appear to control text color at the entire row level.
User avatar
Annabel
Posts: 14
Joined: Mon Jun 16, 2008 3:21 pm

Setting text (not background) color for an entire table row?

Post by Annabel »

What do you mean? There is an example in the manual:

Code: Select all

\begin{tabular}{|l|c|}
\rowcolor[gray]{.9}
one&two\\
\rowcolor[gray]{.5}
three&four
\end{tabular}
You should be able to change gray into whatever colour you like (have a look at the PDF).
oddhack
Posts: 3
Joined: Tue Nov 04, 2008 11:50 am

Setting text (not background) color for an entire table row?

Post by oddhack »

Annabel wrote:What do you mean? There is an example in the manual:
...
You should be able to change gray into whatever colour you like (have a look at the PDF).
I am looking at it and the text color is black in both rows. It is only the background color that's affected by the \rowcolor (unless you're looking at some different PDF - I'm on page 5 of this colortbl.pdf.
User avatar
Annabel
Posts: 14
Joined: Mon Jun 16, 2008 3:21 pm

Re: Setting text (not background) color for an entire table row?

Post by Annabel »

I'm really really sorry. I had not carefully read the original question and thread title.
Post Reply