Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

excel

latex

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:

enter image description here

like image 545
amynbe Avatar asked Apr 26 '10 16:04

amynbe


1 Answers

Short answer: LaTeX regular tables don't have that capability.

Long answer: It can surely be done but with more effort, as shown by similar (but not quite the same) questions in Tex.Stackexchange:

  • Inclined line between two cells in a table
  • Diagonal lines in table cell
like image 142
madth3 Avatar answered Sep 23 '22 10:09

madth3