I am trying to horizontally align text that has been rotated in a table. I want the rotated "Lorem Ipsum" and the rotated "Lorem Ipsum & Lorem Ipsum" text to be horizontally centered in the cell. When I adjust the width of each column manually, the alignment is no longer centered. I need to modify the width of each column so that my table will fit in the width of a single column.
I tried using the \multirow
command from How can I align rotated text in a table at the bottom? but I was only able to modify the vertical alignment.
Here is what my table looks like:
Here is the code (apologies if I included some unnecessary packages):
\documentclass{article}
\usepackage{array}
\usepackage{tabularx}
\usepackage{rotating}
\usepackage{lipsum}
\usepackage{multirow}
\begin{document}
\newcommand\RotText[1]{\fontsize{9}{9}\selectfont \rotatebox[origin=c]{90}{\parbox{2.6cm}{\centering#1}}}
\newcolumntype{G}{>{\centering\arraybackslash}m{.0625cm}}
\newcolumntype{U}{>{\centering\arraybackslash}m{.375cm}}
{\centering
\begin{center}\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}
\end{center}
}
\lipsum
\end{document}