It's a known issue. When you say \raggedright
, the command \\
is redefined. This causes no harm until you want to terminate a table row: LaTeX finds the \\
as defined by \raggedright
which doesn't mean the same thing as normally in tabular
. Write
\newcolumntype{x}[1]{>{\raggedright\arraybackslash}p{#1}}
and use \newline
if you want to terminate a line in one of the cells. Or use your definition and terminate table rows with \tabularnewline
.