LaTeX forum ⇒ GeneralRotate text in tables

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

Rotate text in tables

Postby erhnam » Fri Jan 19, 2007 1:53 am

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

Tags:

Rémi
Posts: 9
Joined: Sun Jan 14, 2007 4:14 pm
Location: France (nord)

Postby Rémi » Fri Jan 19, 2007 9:05 am

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 :

  1. \begin{tabular}{|c|c|c|c|}
  2. \hline
  3. & \rotatebox{90}{bidule}
  4. & \rotatebox{90}{machin}
  5. & \rotatebox{90}{chose}
  6. \hline
  7. truc & 1 & 2 & 3 \\
  8. \hline
  9. \hline
  10. truc & 1 & 2 & 3 \\
  11. \hline
  12. truc & 1 & 2 & 3 \\
  13. \hline
  14. \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.]
Sorry for my english. I'm french.

Rémi
Posts: 9
Joined: Sun Jan 14, 2007 4:14 pm
Location: France (nord)

Postby Rémi » Fri Jan 19, 2007 1:45 pm

[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 4745 times
tabular.tex
(1.78 KiB) Downloaded 2903 times
Sorry for my english. I'm french.

dustbinbear
Posts: 19
Joined: Wed Jan 17, 2007 11:42 am

Postby dustbinbear » Fri Jan 19, 2007 2:45 pm

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

Postby erhnam » Fri Jan 19, 2007 7:54 pm

@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!


Return to “General”

Who is online

Users browsing this forum: No registered users and 8 guests