8

I have a code that produces a table. The three last columns have rotated text. I would like to align them to the bottom (not top as in the code below). In addition I would like to center the "nr" and "NAME" columns both vertically and horizontally in the cell they occupy. Can somebody please help me to achieve this?

\documentclass[a4paper]{article}
\usepackage{rotating}
\usepackage{multirow}
\usepackage{array}
\usepackage{makecell}
\usepackage{booktabs}

\begin{document}

\thispagestyle{empty}

\begin{sidewaystable}

\begin{tabular}{|l|m{10cm}|l|l|l|l|l|l|l|l|l|l|l|l|l|l|r|r|r|}
\hline
nr. & NAME & DATE: & & & & & & & & &
& & & & & \multirow{2}{*}{\rotatebox{90}{POINTS}} & \multirow{2}{*}{\rotatebox{90}{QUALITY}} & \multirow{2}{*}{\rotatebox{90}{PLACE}} \\ [0.6cm]
\cline{3-16}
& & ROUND: & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & & & \\ [0.6cm]
\hline
1 & \multicolumn{2}{c|}{} & & & & & & & & & & & & & & & & \\hline
2 & \multicolumn{2}{c|}{} & & & & & & & & & & & & & & & & \\hline
3 & \multicolumn{2}{c|}{} & & & & & & & & & & & & & & & & \\hline
4 & \multicolumn{2}{c|}{} & & & & & & & & & & & & & & & & \\hline
5 & \multicolumn{2}{c|}{} & & & & & & & & & & & & & & & & \\hline
6 & \multicolumn{2}{c|}{} & & & & & & & & & & & & & & & & \\hline
7 & \multicolumn{2}{c|}{} & & & & & & & & & & & & & & & & \\hline
8 & \multicolumn{2}{c|}{} & & & & & & & & & & & & & & & & \\hline
9 & \multicolumn{2}{c|}{} & & & & & & & & & & & & & & & & \\hline
10 & \multicolumn{2}{c|}{} & & & & & & & & & & & & & & & & \\hline
11 & \multicolumn{2}{c|}{} & & & & & & & & & & & & & & & & \\hline
12 & \multicolumn{2}{c|}{} & & & & & & & & & & & & & & & & \\hline
13 & \multicolumn{2}{c|}{} & & & & & & & & & & & & & & & & \\hline
14 & \multicolumn{2}{c|}{} & & & & & & & & & & & & & & & & \\hline
\end{tabular}

\end{sidewaystable}

\end{document}
Stefan Kottwitz
  • 231,401
chessaddict
  • 83
  • 1
  • 3

1 Answers1

4

You can use the second optional argument of \multirow to fine tune the position:

\documentclass[a4paper]{article}
\usepackage{rotating}
\usepackage{multirow}
\usepackage{array}
\usepackage{makecell}
\usepackage{booktabs}

\begin{document}

\thispagestyle{empty}

\begin{sidewaystable}

\begin{tabular}{|l|m{10cm}|l|l|l|l|l|l|l|l|l|l|l|l|l|l|r|r|r|}
\hline
\multirow{5}{*}{nr.} & \multicolumn{1}{c|}{\multirow{5}{*}{NAME}} & DATE: & & & & & & & & &
& & & & & 
\multirow{2}{*}[-17.5pt]{\rotatebox{90}{POINTS}} 
& \multirow{2}{*}[-9pt]{\rotatebox{90}{QUALITY}} & \multirow{2}{*}[-21pt]{\rotatebox{90}{PLACE}} \\ [0.6cm]
\cline{3-16}
& & ROUND: & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & & & \\ [0.6cm]
\hline
1 & \multicolumn{2}{c|}{} & & & & & & & & & & & & & & & & \\
\hline
2 & \multicolumn{2}{c|}{} & & & & & & & & & & & & & & & & \\
\hline
3 & \multicolumn{2}{c|}{} & & & & & & & & & & & & & & & & \\
\hline
4 & \multicolumn{2}{c|}{} & & & & & & & & & & & & & & & & \\
\hline
5 & \multicolumn{2}{c|}{} & & & & & & & & & & & & & & & & \\
\hline
6 & \multicolumn{2}{c|}{} & & & & & & & & & & & & & & & & \\
\hline
7 & \multicolumn{2}{c|}{} & & & & & & & & & & & & & & & & \\
\hline
8 & \multicolumn{2}{c|}{} & & & & & & & & & & & & & & & & \\
\hline
9 & \multicolumn{2}{c|}{} & & & & & & & & & & & & & & & & \\
\hline
10 & \multicolumn{2}{c|}{} & & & & & & & & & & & & & & & & \\
\hline
11 & \multicolumn{2}{c|}{} & & & & & & & & & & & & & & & & \\
\hline
12 & \multicolumn{2}{c|}{} & & & & & & & & & & & & & & & & \\
\hline
13 & \multicolumn{2}{c|}{} & & & & & & & & & & & & & & & & \\
\hline
14 & \multicolumn{2}{c|}{} & & & & & & & & & & & & & & & & \\
\hline
\end{tabular}

\end{sidewaystable}

\end{document}

enter image description here

Moriambar
  • 11,466
Gonzalo Medina
  • 505,128
  • Thanks! That solved the first problem. Did you experiment to find the right numbers (-17.5pt, -9pt and -21pt)? Do you know how to center the "nr." and "NAME" both vertically and horizontally? – chessaddict Sep 01 '12 at 18:34
  • use \newcolumntype{M}[1]{>{\centering}m{#1}} and change m{10cm} to M{10cm} to get closer to centering – cmhughes Sep 01 '12 at 18:37
  • @chessaddict my bad. I didn't read carefully your question, so I overlooked the second requirement. I've updated my answer; it is something like that what you need? And, yes, the values for the second argument were determined "manually". – Gonzalo Medina Sep 01 '12 at 18:42
  • Then it is centered horizontally, but not vertically. Is it possible to do vertically as well? – chessaddict Sep 01 '12 at 18:43
  • Thank you Gonzalo. My comment was to cmhughes. Gonzalo your last edit made my day. Thanks for your very quick response! It is working as specified now. – chessaddict Sep 01 '12 at 18:48
  • Any tricks for getting the labels not upside down but upright in the last columns? – Has QUIT--Anony-Mousse Feb 11 '13 at 15:34
  • @Anony-Mousse if I understand your request, you can simply not use the \rotatebox commands and just \multirow. – Gonzalo Medina Feb 13 '13 at 16:30
  • @GonzaloMedina no, then they're rotated left. Look at "PLACE" in the picture. I tried \rotatebox{-90} but then the layout is broken. – Has QUIT--Anony-Mousse Feb 13 '13 at 19:14
  • See also http://www.latex-community.org/forum/viewtopic.php?f=5&t=2990, http://tex.stackexchange.com/a/24550/8272 for the option \rotatebox[origin=c]{90}{...}. – Nikos Alexandris Jul 23 '14 at 23:48