# Table with rotated header issue [duplicate]

I want to achieve a table with the headers being rotated 90 degree so that it appears bottom up.

I use the following code with both rotation 90 and -90 but I am facing different errors. Here is the code:

\documentclass[graybox,envcountchap,sectrefs]{svmono}
\usepackage{rotating}
\usepackage{amssymb}% http://ctan.org/pkg/amssymb
\usepackage{pifont}% http://ctan.org/pkg/pifont
\usepackage{array}
\newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}}

\begin{document}
\begin{table}
\begin{tabular}{ | P{4cm} | P{1cm} |  P{1cm} }
\hline
col 0
& \begin{rotate}{90} Col1 \end{rotate}
& \begin{rotate}{-90} Col2 too much text is written here that i want to split on multiple line but rotated 90 degree \end{rotate}\\[25ex]
\svhline
first row & \checkmark & \ding{55} \\
\hline
\end{tabular}
\end{table}
\end{document}


Here is the output:

So my questions are:

1. How to start from the button towards the top like first 'Col1' but to start from the bottom of the cell
2. How to make it fit the cell size and use multi rotated line, shall I do that by hand or can it be made in an automatic manner, and if by hand how can that be done

Here is a link to the class svmono.cs

## marked as duplicate by gernot, Henri Menke, Stefan Pinnow, Kurt, egreg tables StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Dec 21 '16 at 16:22

• Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. – user36296 Dec 21 '16 at 14:24
• Done. Shall I add a link to the style ? – Kasparov92 Dec 21 '16 at 14:27
• would be nice. I found one at static.springer.com/sgw/documents/72921/application/zip/… but I do get the error Undefined control sequence. \svhline – user36296 Dec 21 '16 at 14:33
• @samcarter Done – Kasparov92 Dec 21 '16 at 14:37
• – user36296 Dec 21 '16 at 14:43

My Advice would be, to create a new column type, say R for rotated. In that column, you fill in the text into a minipage. The minipage can break overfull lines and arrange them accordingly. To do so, you have to define the width of the minipage. As the minipage will be rotated afterwards, the formerly width will result in the height of your cell.

This is my MWE

\documentclass{article}
\usepackage{rotating}
\usepackage{amssymb}% http://ctan.org/pkg/amssymb
\usepackage{pifont}% http://ctan.org/pkg/pifont
\usepackage{array}
\newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}}
%% New definition (\scriptsize can be deleted)
\newcolumntype{R}[1]{%
>{\begin{turn}{90}\begin{minipage}{#1}%
\scriptsize\raggedright\hspace{0pt}}l%
<{\end{minipage}\end{turn}}}

\begin{document}
\begin{table}
\begin{tabular}{ | P{4cm} | P{1cm} |  P{1cm} }
\hline
col 0
%% now insert our new columns.
%% Don't forget, you have to repeat the
%% column delimiters "|" in your declaration!
& \multicolumn{1}{R{5em}}{Col1}
& \multicolumn{1}{|R{5em}}{Col2 too much text is written here that i want to split on multiple line but rotated 90 degree}\\%[25ex]
\hline
first row & \checkmark & \ding{55} \\
\hline
\end{tabular}
\end{table}
\end{document}

• Nice idea & explanation! – Kasparov92 Dec 21 '16 at 16:20