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}

1 Answer 1

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

9
  • 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? Sep 1, 2012 at 18:34
  • use \newcolumntype{M}[1]{>{\centering}m{#1}} and change m{10cm} to M{10cm} to get closer to centering
    – cmhughes
    Sep 1, 2012 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". Sep 1, 2012 at 18:42
  • Then it is centered horizontally, but not vertically. Is it possible to do vertically as well? Sep 1, 2012 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. Sep 1, 2012 at 18:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .