It appears that when using xcolor along with tabular, coloring the text of a cell inside a paragraph columns breaks its alignment:
\documentclass{article}
\usepackage{array}
\usepackage{xcolor}
\definecolor{darktext}{HTML}{414141}
\begin{document}
\begin{tabular}{c p{5cm}}
test1 & {\color{darktext} test2} \\
test3 & test4 \\
\end{tabular}
\end{document}
Is this a bug or intended? Is there some alternative to doing this?
{\leavevmode\color{darktext} test2}. A number of LaTeX commands are not intended for use in vertical mode. – Steven B. Segletes Jan 05 '17 at 19:14\textcolor{darktext}{test2}– David Carlisle Jan 05 '17 at 19:14