# Table headers colliding with table title

I have a table that has some vertical column headers, but they keep colliding with the table title. I've tried making the top row taller but that did not help the solution, simply moved all the text higher but they were still colliding

A simple example is given below

\documentclass[12pt,leftblank]{article}
\usepackage{amsmath, amsthm, amssymb, mathtools}
\usepackage{rotating}

\begin{document}
\begin{table}[H]
\centering
\caption{Table Title}
\footnotesize
\begin{tabular}{lll}
& \begin{rotate}{60}Long Column Title 1\end{rotate} & \begin{rotate}{60}Long Column Title 2\end{rotate} \\
Row 1 & Data & Data\\
Row 2 & Data & Data\\
\end{tabular}
\end{table}

\end{document}


From the documentation of the rotating package:

rotate prints the contents turned through an arbitrary angle but does not leave any space for the result

You have to use turn, but this would leave the horizontal space. I propose a new command that only makes zero width, but keeps the height.

\documentclass[12pt,leftblank]{article}
\usepackage{amsmath, amsthm, amssymb, mathtools}
\usepackage{rotating}

\newcommand{\zwturn}[2]{%
\makebox[0pt][l]{\begin{turn}{#1}#2\end{turn}}%
}

\begin{document}
\begin{table}
\centering
\caption{Table Title}
\medskip

\footnotesize
\begin{tabular}{lll}
& \zwturn{60}{Long Column Title 1}
& \zwturn{60}{Long Column Title 2} \\
Row 1 & Data & Data\\
Row 2 & Data & Data\\
\end{tabular}
\end{table}

\end{document}


However, it's better to avoid rotated headers.

You ca also use \rotatebox macro provided by graphicx package.

\documentclass[12pt,leftblank]{article}
\usepackage{amsmath, amsthm, amssymb, mathtools}
%\usepackage{rotating}

\newcommand{\zwturn}[2]{%
\rotatebox[origin=c]{#1}{#2}%
}

\begin{document}
\begin{table}
\centering
\caption{Table Title}
\medskip

\footnotesize
\begin{tabular}{lll}
& \zwturn{60}{Long Column Title 1}
& \zwturn{60}{Long Column Title 2} \\
Row 1 & Data & Data\\
Row 2 & Data & Data\\
\end{tabular}
\end{table}

\end{document}