How to draw diagonal table borders in latex, like in excel ?

Posted by Amyn Bennamane on Stack Overflow See other posts from Stack Overflow or by Amyn Bennamane
Published on 2010-04-26T16:13:51Z Indexed on 2010/04/29 22:27 UTC
Read the original article Hit count: 417

Filed under:
|
|

Is it possible to draw diagonal (parallelogram) cells in LaTeX: the cell content is diagonal, and the cell's originally vertical borders are also diagonal.

Here is what I managed to do using the rotating package:

\begin{tabular}{|r|c|c|}
\hline
\\ \\ \\ \\ \\ \\ \\ \\ \\ \\
 & \begin{rotate}{45}Trying to save some horizontal space\end{rotate} & \begin{rotate}{45}While keeping headers readable\end{rotate} \\
\hline
this & is & a \\
\hline
sample & latex & table \\
\hline
\end{tabular}

Here is a screenshot of the output vs what is possible using excel:

LaTeX vs. Excel screenshots

Thanks.

© Stack Overflow or respective owner

Related posts about latex

Related posts about excel