Deyan Ginev edited subsection_Advanced_Table_Colors__.tex  almost 9 years ago

Commit id: fa2aedc7b96670d66146f806597d32fb83905dec

deletions | additions      

       

\subsection{Advanced Table Colors} In Section \ref{sec:textcolor} we showed the extended set of colors available through the \verb|xcolor.sty| package. For tables, however, it is also useful to have control over the background color of individual rows. For instance:  \begin{lstlisting}  \setlength{\arrayrulewidth}{1mm}  \setlength{\tabcolsep}{18pt}  \renewcommand{\arraystretch}{2.5}    {\rowcolors{3}{green!80!yellow!50}{green!70!yellow!40}  \begin{tabular}{ |p{3cm}|p{3cm}|p{3cm}| }  \hline  \multicolumn{3}{|c|}{Country List} \\  \hline  Country Name or Area Name& ISO ALPHA 2 Code &ISO ALPHA 3 \\  \hline  Afghanistan & AF &AFG \\  Aland Islands & AX & ALA \\  Albania &AL & ALB \\  Algeria &DZ & DZA \\  American Samoa & AS & ASM \\  Andorra & AD & AND \\  Angola & AO & AGO \\  \hline  \end{tabular}  }  \end{lstlisting}  \setlength{\arrayrulewidth}{1mm}  \setlength{\tabcolsep}{18pt}  \renewcommand{\arraystretch}{2.5}    {\rowcolors{3}{green!80!yellow!50}{green!70!yellow!40}  \begin{tabular}{ |p{3cm}|p{3cm}|p{3cm}| }  \hline  \multicolumn{3}{|c|}{Country List} \\  \hline  Country Name or Area Name& ISO ALPHA 2 Code &ISO ALPHA 3 \\  \hline  Afghanistan & AF &AFG \\  Aland Islands & AX & ALA \\  Albania &AL & ALB \\  Algeria &DZ & DZA \\  American Samoa & AS & ASM \\  Andorra & AD & AND \\  Angola & AO & AGO \\  \hline  \end{tabular}  }