Newsgroups: comp.text.tex
> i can background shade a row of text with the following sequence: > \colorbox[gray]{0.90}{\makebox[\textwidth][l]{#1}}
> how can i do that for a row of a tabular-table?
Use the colortbl package. It has a \rowcolor command.
Piet van Oostrum
\begin{tabular}{|l|c|} \rowcolor[gray]{.9} one&two\\ \rowcolor[gray]{.5} three&four \end{tabular}
NB, this command is not recognized by either latex2html or latex2rtf.
http://www.mip.sdu.dk/~mads/latex.php3
It is also possible to make some nice things on the tables. If you want to have some of the rows with color you can use the package colortbl.sty. If you for instance want to make a small table with a black row then use can small example could be:
Preamble: \usepackage{colortbl} Example: \begin{table}[!ht] \begin{center} \begin{tabular}{ |c| } \hline \rowcolor{black} \\ \hline Hello World\\ \hline \end{tabular} \caption{\label{SomeLabel} The Caption!} \end{center} \end{table}
http://www.mackichan.com/index.html?techtalk/476.htm~mainFrame
The package produces colored background panels and rules for specified columns or rows of a table or array. Colortbl implements LaTeX support for color when the active dvi driver can produce colored text.
You can add color to a row in a table by inserting a package command in the table. Adding color to a column is more complex: you must enter the colortbl package commands, along with commands for the entire tabular environment, in an encapsulated TeX field. You indicate the size of each color panel and the corresponding color you want with commands placed at the start of the tabular environment.
The basic command syntax is as follows:
\columncolor[w]{x}[y][z] or \rowcolor[w]{x}[y][z]
where
w is the color model: rgb (red, green, blue); cmyk (cyan, magenta, yellow, black); gray; or named (names known to the selected driver),
x is the selected color,
y is the amount of left overhang past the widest entry in the column, and
z is the amount of right overhang past the widest entry in the column.
See the package documentation for instructions and for additional examples of package effects.
Many driver options are available through the Options and Packages command on the Typeset menu. The package is installed in the TCITeX/TeX/LaTeX/contrib/supported/carlisle directory. It should work successfully with other packages that have syntax compatible to that of the array package, such as longtable and dcolumn.
MacKichan Software, Inc