Is there some way to color only part of a table cell? For example, the top third, or bottom half of a cell?
For example:
\renewcommand{\arraystretch}{3.0}
\begin{tabularx}{10cm}{|X|X|}
\hline
Row 1 & \cellcolor{blue!25} 1/3 colored \\
\hline
Row 2 & uncolored \\
\hline
\end{tabularx}
\renewcommand{\arraystretch}{1.0}
\begin{tabularx}{10cm}{|X|X|}
\hline
&\cellcolor{blue!25} \\
& \\
& \\
\hline
& \\
& \\
& \\
\hline
\end{tabularx}
\renewcommand{\arraystretch}{1.0}
\begin{tabularx}{10cm}{|X|X|}
\hline
Row 1 &\cellcolor{blue!25} 1/3 colored\\
& \\
& \\
\hline
Row 2 & uncolored \\
& \\
& \\
\hline
\end{tabularx}
The first case shows how the text should appear, but clearly the cell is fully colored. In the second case, I split the two rows into six rows so that one third of the original cell can be individually colored. But when adding the text, it is no longer center in the middle of the true cells because it is put in the subcells.
What is the best way to do this?
\documentclass
command, include any necessary packages and be as small as possible to demonstrate your problem. At the moment we have to guess what packages etc you are using before we can compile your code.