This produces a 2x2 table whose first row is blue with white text and whose second row is white with black text. Although it works fine it does repeat \textcolor{white} in each cell of the row where the cells are to have white text. Is there some way of specifying that the text in the first row should be white without having to repeatedly specify it over again for each cell of that row? Its not so bad in this small example but I am concerned that it will get tiresome on larger tables.
\documentclass{article}
\usepackage{tabularx}
\usepackage{ragged2e}
\usepackage{colortbl}
\newcolumntype{L}{>{\raggedright\arraybackslash}X}
\begin{document}
\begin{center}\Large
\noindent\begin{tabularx}{1\textwidth}{|L|L|}
\hline
% NEXT LINE REPEATS WHITE FOR EACH CELL
\rowcolor{blue}\textcolor{white}{Jan}&\textcolor{white}{Feb}\\
Mar&Apr\\
\hline
\end{tabularx}
\end{center}
\end{document}
EDIT: This question has already been answered and accepted with an answer directly addressing the tabularx environment in the question's example code but since then I found that the tabu package can do this.
As this involves using a different package than that presented in the original question I am not going to put this as an answer but am just adding the following example of how to implement this using tabu in case anyone is interested in another approach.
\documentclass{article}
\usepackage{tabu}
\usepackage{colortbl}
\begin{document}
\begin{center}\Large
\noindent\begin{tabu} to \textwidth{|X[l,m]|X[l,m]|}
\tabucline-
\rowfont{\color{white}}\rowcolor{blue}Jan&Feb\\
Mar&Apr\\
\tabucline-
\end{tabu}
\end{center}
\end{document}
>inserts a command\rtcolorhere into every cell and then at the beginning of each row you could define it to be anything. – David Carlisle Jul 07 '12 at 00:50rtcolortortattrgiving this\newcolumntype{L}{>{\raggedright\arraybackslash\leavevmode\rtattr\ignorespaces}X} \def\rowtext#1{\noalign{\gdef\rtattr{#1}}} \global\let\rtattr\relaxwhich is called like this\rowtext{\color{blue}}so that the attribute can be color or anything else we wish to apply to factor out from the row cells. – user1189687 Jul 07 '12 at 03:09\rtcolorin every cell by assuming that every column will includertcolorin its column spec. Then its a matter of repeatedly redefiningrtcolorat the start of each row so the latest definition is substituted in. Its very clever & I have certainly learned a lot trying to understand it, in particular, the limitations of the environments for tables. I am going to accept it since its likely the best that can be expected given these limitations but the interplay between columns & rows seems complex so I am not sure I will use it in practice. – user1189687 Jul 07 '12 at 04:21