My code follows:
\documentclass{book}
\usepackage{color,colortbl}
\begin{document}
\begin{tabular}{ll>{\color{red}}p{20pc}}
a &1 &Test
\end{tabular}
\end{document}
The output was:
Some unnecessary vertical space came before the last column. If I remove the tag \color{red}
then everything works fine, how can I fix this?
Above said issue was fixed based on the suggestion given by David Carlisle and CarLaTeX, but the same problem was there if I use the supertabular
environment, I used supertabular
package for auto breaking table and the code follows:
\documentclass{book}
\usepackage{color,colortbl,supertabular}
\begin{document}
\begin{supertabular}{ll>{\leavevmode\color{red}}p{4pc}>{\leavevmode\color{black}}l>{\leavevmode\color{black}}l>{\leavevmode\color{red}}p{4pc}}
a &1 &Test &a &1 &Test\\
a &1 &Test &a &1 &Test\\
\end{supertabular}
\end{document}
\usepackage{color,colortbl}
isn't quite correct. You should use\usepackage[table]{xcolor}
to maximize the interoperability of the[x]color
andcolortbl
packages.