[Tex/LaTex] Sideways table with rotated header on multiple pages

landscapelongtablerotatingtables

I am trying to have a sideways table on multiple pages with the header rotated at 90 deg.

I have used landscape and longtable for the rotation and multipage span (sidewaystable doesn't work with multipage for some reason).
And I have used \rotatebox{90} for the header.

The header row of the table is too long. I would like to reduce it's height and have the text in those cells be on several "lines".

Sample code:

\documentclass{article}
\usepackage{longtable}
\usepackage{pdflscape}
\usepackage{siunitx}
\begin{document}
\begin{landscape}          

\centering    
\begin{longtable}{|c|c|c|c|c|c|c|c|c|c|c|c|}
\hline
{\rotatebox{90}{\textbf{Experiment No. }}}  &
{\rotatebox{90}{\textbf{Sample  }}}  &
{\rotatebox{90}{\textbf{Temperature  }}}  &
{\rotatebox{90}{\textbf{Sample Weight  }}}  &
{\rotatebox{90}{\textbf{Tar Fraction  }}}  &
{\rotatebox{90}{\textbf{Char Fraction  }}}  &
{\rotatebox{90}{\textbf{Steam Flow Rate [ml/min]  }}}  &
{\rotatebox{90}{\textbf{Nitrogen Flow Rate [ml/min]  }}}  &
{\rotatebox{90}{\textbf{Reaction Distance  }}}  &
{\rotatebox{90}{\textbf{Flow Rate/Sample Weight  }}}  &
{\rotatebox{90}{\textbf{Residence Time [s]  }}}  &
{\rotatebox{90}{\textbf{Stochiometric error  }}}  \hline \endhead %\\

017 & ABS & 700\Deg & 0.56 & 24.0\% & 0\% & 0.000 & 250.000 & 0.6 & 0.000 & 41.15 & 0.0 \\
029 & ABS & 700\Deg & 1.07 & 23.0\% & 0.0\% & 0.000 & 350.000 & 0.5 & 0.000 & 29.41 & 0.0 \\
021 & ABS & 700\Deg & 1.60 & 24.3\% & 0.0\% & 0.167 & 250.000 & 0.6 & 0.104 & 22.49 & 1.2 \
\end{document}

enter image description here

Best Answer

Is it like this? I used \parbox. The width of parbox may be adjusted as needed.

\documentclass{article}
\usepackage{longtable}
\usepackage{pdflscape}
\usepackage{siunitx}
\begin{document}
\begin{landscape}
%\begin{sidewaystable}

\centering
%\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|}
\begin{longtable}{|c|c|c|c|c|c|c|c|c|c|c|c|}
\hline
{\rotatebox{90}{\parbox[t]{3cm}{\raggedright\textbf{Experiment No. }}}}  &
{\rotatebox{90}{\parbox[t]{3cm}{\raggedright\textbf{Sample  }}}}  &
{\rotatebox{90}{\parbox[t]{3cm}{\raggedright\textbf{Temperature  }}}}  &
{\rotatebox{90}{\parbox[t]{3cm}{\raggedright\textbf{Sample Weight  }}}}  &
{\rotatebox{90}{\parbox[t]{3cm}{\raggedright\textbf{Tar Fraction  }}}}  &
{\rotatebox{90}{\parbox[t]{3cm}{\raggedright\textbf{Char Fraction  }}}}  &
{\rotatebox{90}{\parbox[t]{3cm}{\raggedright\textbf{Steam Flow Rate [ml/min]  }}}}  &
{\rotatebox{90}{\parbox[t]{3cm}{\raggedright\textbf{Nitrogen Flow Rate [ml/min]  }}}}  &
{\rotatebox{90}{\parbox[t]{3cm}{\raggedright\textbf{Reaction Distance  }}}}  &
{\rotatebox{90}{\parbox[t]{3cm}{\raggedright\textbf{Flow Rate/Sample Weight  }}}}  &
{\rotatebox{90}{\parbox[t]{3cm}{\raggedright\textbf{Residence Time [s]  }}}}  &
{\rotatebox{90}{\parbox[t]{3cm}{\raggedright\textbf{Stochiometric error  }}}} \\
 \hline \endhead %\\

017 & ABS & \SI{700}{\degree} & 0.56 & 24.0\% & 0\% & 0.000 & 250.000 & 0.6 & 0.000 & 41.15 & 0.0 \\
029 & ABS & \SI{700}{\degree} & 1.07 & 23.0\% & 0.0\% & 0.000 & 350.000 & 0.5 & 0.000 & 29.41 & 0.0 \\
021 & ABS & \SI{700}{\degree} & 1.60 & 24.3\% & 0.0\% & 0.167 & 250.000 & 0.6 & 0.104 & 22.49 & 1.2 \\
\end{longtable}
\end{landscape}
\end{document}

enter image description here

You may also use \SI{700}{\celsius}. See the siunitx manual for using the SI units..

Related Question