rotate table headings

rotate table headings

by Gustav W Delius -
Number of replies: 6

I have always had the problem that the grades table was extremely wide because each column had to be as wide as the name of the assignment. I now found the solution: rotate the table headings by 90 degrees. I saw this done in phpmyadmin. It is easy: the table heading simply needs to be enclosed in

<div style="text-align: right; writing-mode: tb-rl;"> ..... </div> 

The table headings are set in /course/grades.php in lines 85 and 90. To make things look nicer I also changed the print_table function in lib/weblib.php in line 1089 to use valign="bottom" for table headings. Finally I had to make gradient.jpg in my theme folder a bit higher in order not to get repeated gradients in the now quite high table heading. Screenshot is attached.

Attachment Image1.gif
Average of ratings: -
In reply to Gustav W Delius

Re: rotate table headings

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Very nice, thanks! I'll definitely get that into the new theme stuff. (Unfortunately it seems to be IE only at this stage)
In reply to Gustav W Delius

Re: rotate table headings

by Thomas Haynes -
I have tried to rotate table headings in the 1.4 beta, and I am not seeing exactly where to insert the lines.

I am pretty sure it is not lines 85 and 90 any more, but if it is, perhaps I should not be making chaanges like this.

Thanks...   Tom
In reply to Thomas Haynes

Re: rotate table headings

by Gustav W Delius -

Hi Tom,

I only just saw your message. It is now lines 102 and 107 where $columnhtml is being built.

Note however that unfortunately Mozilla is still not HTML compliant in this respect and won't rotate the column headings.

In reply to Gustav W Delius

Re: rotate table headings

by Sam Wynens -
Bringing this back from the dead...

Any idea how to do this in 1.6?

Sam
In reply to Sam Wynens

Re: rotate table headings

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
In Moodle 1.6 (and 1.7) you can add the following to one of the CSS stylesheets of your current theme:
#grade-index #content th.assignment a,
#grade-index #content th.lesson a,
#grade-index #content th.quiz a,
#grade-index #content th.hotpot a,
#grade-index #content th.forum a {
writing-mode : tb-rl;
}
Works with MSIE 7.0; does not work with Firefox 2.0.
Joseph
In reply to Gustav W Delius

Re: rotate table headings

by Vicki Dunnam -
I am using Moodle 1.9.2 in Linux environment.  Can you tell me how to fix the gradebook headings to rotate  - like in your discussions several years ago.