General ⇒ Center Sideways Text in Table
Center Sideways Text in Table
Example:
\begin{tabular}{|c|c|c|}
\hline
& \begin{sideways}USERNAME\end{sideways}&
\begin{sideways}PASSW\end{sideways}\\
\hline
NAME1 & x & x \\
\hline
NAME2 & x & x \\
\hline
\end{tabular}
I wish to vertically center the sideways text 'USERNAME' and 'PAS' .
I would like to avoid using the \array package.
Many thanks in advance,
Nick
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Center Sideways Text in Table
Code: Select all
\begin{tabular}{|*{3}{c|}} \cline{2-3}
\multicolumn{1}{c|}{}&\rotatebox{90}{USERNAME}&\rotatebox{90}{\makebox[\widthof{USERNAME}]{PASSW}} \\ \hline
NAME1 & x & x \\ \hline
NAME2 & x & x \\ \hline
\end{tabular}
Best regards
Thorsten¹
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10