Graphics, Figures & Tablestable with rotated headings - spacing

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
dyde
Posts: 2
Joined: Mon Oct 28, 2019 2:27 pm

table with rotated headings - spacing

Post by dyde »

Hi@all,

sorry to bother you but although I tried the search function, I could not find a solution to my specific problem.

I am using a table in latex with rotated headings:

Code: Select all

\newcommand*\rot{\rotatebox{90}}
\begin{table}
  \caption{Table caption.}
    \begin{threeparttable}
      \begin{tabular}{ | l || c | c | }
        \hline
	\centering
	\diagbox[innerwidth=18em]{Text}{\raisebox{-0.27cm}{Method}} & \rot{Head1} & \rot{Head2} \\ \hline															
	Description & foo\tnote{1} & bar \\ \hline
       \end{tabular}
      \begin{tablenotes}
        \item[1] Note
      \end{tablenotes}
    \end{threeparttable}
  \label{tbl:table}
\end{table}
with the following result:
tableprob.png
tableprob.png (18.59 KiB) Viewed 6502 times
How can I modify the spacing of the headings? The big space between the delimiter and the "Head1"/"Head2" seems a bit odd...

Thanks a lot for any help!

Greetings

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

table with rotated headings - spacing

Post by Stefan Kottwitz »

Hi dyde,

welcome to the forum!

You could use the origin option, such as here, centered:

Code: Select all

\rotatebox[origin=c]{90}
Stefan
LaTeX.org admin
dyde
Posts: 2
Joined: Mon Oct 28, 2019 2:27 pm

table with rotated headings - spacing

Post by dyde »

Hi Stefan,

thanks a lot, that worked for me :)
Stefan Kottwitz wrote:Hi dyde,

welcome to the forum!

You could use the origin option, such as here, centered:

Code: Select all

\rotatebox[origin=c]{90}
Stefan
Post Reply