I'm trying to create a timetable using tabularx environment, but i can't find a way to center all columns.
Using this code:
\documentclass[11pt,oneside, landscape]{article}
\usepackage[utf8]{inputenc}
\usepackage{geometry}
\geometry{a4paper}
\usepackage[osf]{mathpazo}
\linespread{1.05}\selectfont
\usepackage{graphicx}
\usepackage[dvipsnames]{xcolor}
\usepackage{booktabs}
\usepackage{array}
\usepackage{tabularx}
\usepackage{fancyhdr}
\pagestyle{empty}
\newcommand{\tit}[1]{\fontsize{15}{17}\color{darkgray}\usefont{T1}{pplj}{b}{it}\selectfont #1}
\begin{document}
\begin{center}
\renewcommand{\arraystretch}{1.5}
\begin{tabularx}{19cm}{r >{\centering}X >{\centering}X >{\centering}X >{\centering}X X}
& \tit{Lun} & \tit{Mar} & \tit{Mer} & \tit{Gio} & \tit{Ven} \\
\toprule
\color{gray}9-11 $||$ & & Laboratorio III & & Metodi mat. per la fisica & Laboratorio III \\ \midrule
\color{gray}11-13 $||$& Meccanica Quantistica & Metodi mat. per la fisica & & Meccanica Quantistica & Fisica dell'informazione \\ \midrule
\midrule
\color{gray}15-17 $||$ & & Fisica dell'informazione & Laboratorio III & & \\
\bottomrule
\end{tabularx}
\end{center}
\end{document}
i get this
where last column is not centered. If i try to change
\begin{tabularx}{19cm}{r >{\centering}X >{\centering}X >{\centering}X >{\centering}X X}
with
\begin{tabularx}{19cm}{r >{\centering}X >{\centering}X >{\centering}X >{\centering}X {\centering}X}
i get
! Misplaced \noalign.
\toprule ->\noalign
{\ifnum 0=`}\fi \@aboverulesep =\abovetopsep \global \@b...
l.39 \end{tabularx}