How to horizontally align rotated text in a table?
Your box was far wider than the specified width of the column, so centreing could not work. Also don't put the table inside a center environment it will float away leaving spurious vertical space from the center display with nothing in it.
\documentclass{article}
\usepackage{array}
\usepackage{tabularx}
\usepackage{rotating}
\usepackage{lipsum}
\usepackage{multirow}
\begin{document}
\newcommand\RotText[1]{\rotatebox[origin=c]{90}{\parbox{2.6cm}{\centering#1}}}
\newcolumntype{G}{>{\centering\arraybackslash}m{.6cm}}
\newcolumntype{U}{>{\centering\arraybackslash}m{.6cm}}
\setlength\extrarowheight{3pt}
\begin{table}[ht]\caption{Lorem Ipsum Table}
\footnotesize
\centering
\begin{tabular}{|c|G|U|U|U|U|G|G|G|U|}
\hline
& \multicolumn{9}{c|}{Lorem Ipsum} \\
\cline{2-10}
Instruction & \RotText{Lorem Ipsum} & \RotText{Lorem Ipsum \& Lorem Ipsum} & \RotText{Lorem Ipsum \& Lorem Ipsum} & \RotText{Lorem Ipsum \& Lorem Ipsum} &
\RotText{Lorem Ipsum \& Lorem Ipsum} & \RotText{Lorem Ipsum} & \RotText{Lorem Ipsum} & \RotText{Lorem Ipsum} & \RotText{Lorem Ipsum \& Lorem Ipsum} \\
\hline
Lorem Ipsum &
& & X & & & & & & \\
\hline
\end{tabular}
\end{table}
\lipsum
\end{document}
REVISED SOLUTION
One of the problems with your MWE and my earlier tweak thereof was that it did not account for the natural space allocated, by default, between columns, defined by the length \tabcolsep
. If narrow is desired, the first thing to do is turn that off, with \setlength\tabcolsep{0pt}
. Then, there are no \vspace
tweaks required, and the problem becomes determining the column width that satisfies your requirement.
Here, I strove to make the columns as narrow as possible, again, with no tweaking. Note, I saved a copy of \tabcolsep
into \svtabcolsep
, if I need to reinstate it later.
\documentclass{article}
\usepackage{array}
\usepackage{tabularx}
\usepackage{rotating}
\usepackage{lipsum}
\usepackage{multirow}
\begin{document}
\let\svtabcolsep\tabcolsep
\setlength\tabcolsep{0pt}
\newcommand\RotText[1]{\fontsize{9}{9}\selectfont
\rotatebox[origin=c]{90}{\parbox{2.6cm}{%
\centering#1}}}
\newcolumntype{G}{>{\centering\arraybackslash}m{.35cm}}
\newcolumntype{U}{>{\centering\arraybackslash}m{.62cm}}
\begin{table}[ht]\caption{Lorem Ipsum Table}
\footnotesize
\centering
\begin{tabular}{|c|G|U|U|U|U|G|G|G|U|}
\hline
& \multicolumn{9}{c|}{Lorem Ipsum} \\
\cline{2-10}
Instruction & \RotText{Lorem Ipsum} & \RotText{Lorem Ipsum \& Lorem Ipsum} & \RotText{Lorem Ipsum \& Lorem Ipsum} & \RotText{Lorem Ipsum \& Lorem Ipsum} &
\RotText{Lorem Ipsum \& Lorem Ipsum} & \RotText{Lorem Ipsum} & \RotText{Lorem Ipsum} & \RotText{Lorem Ipsum} & \RotText{Lorem Ipsum \& Lorem Ipsum} \\
\hline
Lorem Ipsum &
& & X & & & & & & \\
\hline
\end{tabular}
\end{table}
\lipsum
\end{document}
Note you could even dispense with the G
and U
column types, making them instead c
, and using a small, finite value of \tabcolsep
to achieve your goal.
\let\svtabcolsep\tabcolsep
\setlength\tabcolsep{.3pt}
\newcolumntype{G}{c}
\newcolumntype{U}{c}