So I'm currently on the task of setting up my first table, to use as preset for future documents. While it works, and gives the result I'd like to see (except for {\centering} not working), it does throw 20 "Misplaced \noalign" errors (Misplaced \noalign. ^^I\end{tabularx})
Here's the code:
\documentclass[a4paper,11pt]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{marvosym}
\usepackage{enumerate}
\usepackage{array}
\usepackage{tabularx}
\usepackage{xcolor,colortbl}
\definecolor{Grey}{gray}{0.8}
\definecolor{Groy}{gray}{0.9}
\begin{document}
\begin{tabularx}{375pt}{lX*{3}{>{\sffamily}rX}X}
\vspace{2.5pt}\noindent
\rowcolor{Grey}\textbf{Land} && \textbf{2002} && \textbf{2001} && \textbf{1990}\\\vspace{2.5pt}\noindent
\cellcolor{Grey}USA && 3 800 000 && 3 778 512 && 3 040 932 \\\vspace{2.5pt}\noindent
\rowcolor{Groy} \cellcolor{Grey}VR China && 1 602 156 && 1 421 268 && 618 000\\\vspace{2.5pt}\noindent
\cellcolor{Grey}Japan && 935 000 && 932 904 && 857 268& \\\vspace{2.5pt}\noindent
\rowcolor{Groy} \cellcolor{Grey}Russland && 888 936 && 888 382 && {\centering}-\\\vspace{2.5pt}\noindent
\cellcolor{Grey}Kanada && 565 000 && 564 108 && 482 028 \\\vspace{2.5pt}\noindent
\rowcolor{Groy} \cellcolor{Grey}Frankreich && 549 245 && 545 000 && 419 219 \\\vspace{2.5pt}\noindent
\cellcolor{Grey}Deutschland && 543 561 && 566 835 && 566 484 \\\vspace{2.5pt}\noindent
\rowcolor{Groy} \cellcolor{Grey}Weltproduktion && 15 750 000 && 15 684 000 && 11 179 000\\\vspace{2.5pt}\noindent
\end{tabularx}
\end{document}
So, before I go around using it in something I actually have to turn in, I want it to not throw those errors, or at least understand why they're there... hope you guys can help (and mybe tell me, why centering isn't working?)
\vspace
and\noindent
are wrong in front of\rowcolor
and also after\\
.