views:

256

answers:

3

I'm trying to rotate some text cross browser within a thin table cell that spans a few rows. I want it to be a nice compact summary of the rows, which is why it is thin and rotated -90 degrees. The tips described here:

http://stackoverflow.com/questions/272799/vertical-rotated-text-in-html-table

work like a charm except in, surprise surprise, IE, where the text is rotated, but the text is clipped to the width of the cell.

Here's what it looks like in IE8:

alt text

And in the well behaved browsers:

alt text

here are the relevant styles:

#schedmenu td.label {
/*width:22px;*/
/*width:100%*/
vertical-align:middle;
font-size:12.5px;
}


#schedmenu td.label span {
display:block;
-moz-transform: rotate(-90deg);  /* FF3.5+ */
  -o-transform: rotate(-90deg);  /* Opera 10.5 */
 -webkit-transform: rotate(-90deg);  /* Saf3.1+, Chrome */
        filter:  progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand',
                M11=6.123031769111886e-17, M12=1, M21=-1, M22=6.123031769111886e-17); /* IE6,IE7 */
    -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(SizingMethod='auto expand',
                M11=6.123031769111886e-17, M12=1, M21=-1, M22=6.123031769111886e-17)"; /* IE8 */
          zoom: 1;

color:white;
position:relative;
top:12px;
}

and the html:

<td class="label" rowspan="3"><span>Recent</span></td> 

You will be my hero if you can get me past this one :)

+1  A: 

Have you tried applying a width or height to the span?

Yisroel
Hmm, adding a width to the span does help in the ie case; it will display up to width pixels before clipping. but in safari / chrome / firefox the width effects the width of the cell pre-rotation, resulting in a wider cell than I want.
Karl R
You can also set the width on the table cell and hide the overflow. That should prevent it from displaying the extra width of the span.
Yisroel
nice, that works, but the rotated text is still pushed out to the right (centered within the wider div) for all but ie.... so maybe i could do an ie specific style application for the width of the div...
Karl R
+1  A: 

If I were you, I would have open InkScape and created three different image.

or as you already have printscreened images, just crop it. and put them as background image.

I frequently do some extremely beautiful css design which works in chrome and firefox and then print screen it , crop it and replace the actual design with images and it all works in IE.

or span: dispaly:block and height:100%; ??

iamgopal
yeah, I'll try resort to the image background if I can't find a way to make it work with text. but I'm so close!
Karl R
i can see you have tried real hard , any luck with height:100%; ?
iamgopal
no luck unfortunately with height:100%
Karl R
for what it's worth, I ultimately just used images. not a real programming solution, but perhaps the fact that this wasn't possible cross browser is information in itself.
Karl R
A: 

Not the most elegant way, but it works under IE8 (didn't tried under older versions):

<td class="label" rowspan="3"><span>Recent<br/>&nbsp;</span></td>  
Zsolti
this didn't work for me
Karl R
just deployed a demo if you want to see the full html / css (see my comment on the question for the link)
Karl R