How to format table with long column head entries?

Here's an example using your idea of putting the headers horizontally and connecting them to the columns with arrows:

\documentclass{beamer}
\usepackage{tikz}
\usepackage{tabularx}
\newcommand*{\hnode}[1]{\tikz[remember picture] \node (#1) {};}
% I am actually using a similar theme
% The space ``wasted'' is similar for PaloAlto though
\usetheme{PaloAlto}

\begin{document}
\frame
{
  \frametitle{Comparision of boost implemented graph classes}
  \begin{tabular}{l}
    %
    % Column Headers, first column is empts
    %
    compressed\_sparse\_row\_graph\hnode{H3}\\
    adjacency\_matrix\hnode{H2}\\
    adjacency\_list\hnode{H1}\\
    \\
  \end{tabular}
  \begin{tabularx}{\textwidth}{X c c c}
    %
    & \hnode{C1}
    & \hnode{C2}
    & \hnode{C3}\\
    % Rows, I suspect I need about 10
    % Class               adjlist          adjmatrix     csrg
    \hline 
    AdjacencyGraph        & Yes            & No          & Yes \\
    Interface \#2         & Yes            & No          & Yes \\
    Interface \#3         & Yes            & No          & Yes \\
    Interface \#4         & Yes            & No          & Yes \\
    Interface \#5         & Yes            & No          & Yes \\
    Interface \#6         & Yes            & No          & Yes \\
    Interface \#7         & Yes            & No          & Yes \\
    Interface \#8         & Yes            & No          & Yes \\
    Interface \#9         & Yes            & No          & Yes \\
    % Rest omitted
  \end{tabularx}
\tikz[remember picture,overlay] \draw (H1)  [very thick, red,->] -| (C1);
\tikz[remember picture,overlay] \draw (H2)  [very thick, red,->] -| (C2);
\tikz[remember picture,overlay] \draw (H3)  [very thick, red,->] -| (C3);
}

\end{document}

It actually looks pretty good, if I may say so myself.

beamer slide


& \llap{\rotatebox[origin=rb]{-30}{\small adjacency\_list}}
& \llap{\rotatebox[origin=rb]{-30}{\small adjacency\_matrix}}
& \llap{\rotatebox[origin=rb]{-30}{\small compressed\_sparse\_row\_graph}}\\

maybe a solution

Tags:

Tables