GeneralRotate text in tables

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
erhnam
Posts: 4
Joined: Thu Jan 18, 2007 1:51 pm

Rotate text in tables

Post by erhnam »

The problem is:
I have a table which is a bit too wide to fit in the page.
If I could rotate the column headers the table would fit perfectly.

I've checked CTAN and it seems that rotating is only possible to entire float elements or entire pages (landscaping)
Is there any way to do what I need?

Thks

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
Rémi
Posts: 9
Joined: Sun Jan 14, 2007 4:14 pm

Rotate text in tables

Post by Rémi »

There is a solution to your problem (if I understand it correctly.)
You must use the package graphicx and do the same thing as in a page.
For example :

Code: Select all

\begin{tabular}{|c|c|c|c|}
\hline
& \rotatebox{90}{bidule}
& \rotatebox{90}{machin}
& \rotatebox{90}{chose}
\hline
truc & 1 & 2 & 3 \\
\hline
\hline
truc & 1 & 2 & 3 \\
\hline
truc & 1 & 2 & 3 \\
\hline
\end{tabular}
I couldn't carry out a test but it seems to work well. I try this if i have time.

Rémi.

[Edit : I have realised a test and its well. I could use 270 in the place of 90 according to the orientation of the text.
I have a tex file and a pdf file for illustration but it isn't allowed to join files with this extension sorry.]
Last edited by Rémi on Fri Jan 19, 2007 9:05 am, edited 1 time in total.
Sorry for my english. I'm french.
Rémi
Posts: 9
Joined: Sun Jan 14, 2007 4:14 pm

Rotate text in tables

Post by Rémi »

[Edit : I have realised a test and its well. I could use 270 in the place of 90 according to the orientation of the text.
I have a tex file and a pdf file for illustration but it isn't allowed to join files with this extension sorry.]


Sven have solve the problem, so my files are in this message.
Attachments
tabular.pdf
(3.9 KiB) Downloaded 7327 times
tabular.tex
(1.78 KiB) Downloaded 4502 times
Last edited by Rémi on Fri Jan 19, 2007 1:45 pm, edited 1 time in total.
Sorry for my english. I'm french.
dustbinbear
Posts: 19
Joined: Wed Jan 17, 2007 11:42 am

Re: Rotate text in tables

Post by dustbinbear »

sorry but do u mean rotating the whole table by 90 degrees, or just rotate the text in the table so as to get a shorter table width?
erhnam
Posts: 4
Joined: Thu Jan 18, 2007 1:51 pm

Re: Rotate text in tables

Post by erhnam »

@Sven: Yeah, I kinda posted in the wrong section...

@Rémi: THKS! That was exactly what I needed.

@dustbinbear: I meant rotate the text in the table so as to get a shorter table width. Just like Rémi did.

Thks for the help. Problem solved!
Post Reply