pagid
pagid

Reputation: 13867

How to rotate table-headline in Latex table

is there a way to rotate the "Demo 1", "Demo2" and "Demo 3" headlines 90° in the following LaText table?

\documentclass[a4paper,twoside,10pt]{report}
\begin{document}
\begin{tabular}{|l|l|l|l|}
\hline
 & Demo1 & Demo2 & Demo3 \\
\hline
Person 1 & x &  &    \\
\hline
Person 2 & x &  &  x  \\
\hline
Person 3 & x & x &    \\
\hline
Person 4 &  & x &  x  \\
\hline
\end{tabular}
\end{document}

Thanks

Upvotes: 3

Views: 4778

Answers (1)

Klaus Byskov Pedersen
Klaus Byskov Pedersen

Reputation: 120937

Yes. As Dr. Andrew J. Page wrote on his blog,

Put this at the top of your code:

\usepackage{rotating}

Simply to create a table with rotated column text use this code:

\begin{tabular}{|r|r|}\hline 
\begin{sideways}Paper\end{sideways} &\begin{sideways}Static\end{sideways} \\
\hline
HAR1994j & Journal \\
SWRT1996c & Conference \\
\hline
\end{tabular}

Upvotes: 2

Related Questions