?
Solved

Rotate text in header of table

Posted on 2014-03-06
5
Medium Priority
?
1,112 Views
Last Modified: 2016-09-23
I'm trying to rotate some header texts in a table, however it seems to be a right mess. Im not great at CSS, and really dont understand the mess it causes and how to fix

Would it be possible for someone to assist me in sorting my mess out :-(
http://jsfiddle.net/UNj7d/
0
Comment
Question by:tonelm54
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 39910877
I suggest using a jquery plugin
http://davidjs.com/2011/07/rotate-table-cell-content-jquery/

Getting this to work properly cross browser is a ****
0
 

Author Comment

by:tonelm54
ID: 39911044
Thanks Gary, I had looked at that before, however I wanted to rotate by 270 (or -90) instead of 90 (+90), however I had the same issue as 'Timothy Watson' who also couldnt rotate the text the other way :-(
0
 
LVL 58

Expert Comment

by:Gary
ID: 39911064
You just need to change the CSS to -90

I'm sure this is the one I used some time back, I'll throw a fiddle together now.
0
 
LVL 58

Accepted Solution

by:
Gary earned 2000 total points
ID: 39911150
Sometimes its easier just doing it yourself

http://jsfiddle.net/GaryC123/UNj7d/9/

jQuery in question
var w=0
$("#Table1 th").each(function(){
    $(this).html('<div class="rotated">' + $(this).html() + '</div>')
    $(this).width()>w?w=$(this).width():w=w
})
$("#Table1 th div").each(function(){
    $(this).css("margin-top",(w-$(this).width()+5)+"px")
})

Open in new window

May need some tweaking
0
 

Expert Comment

by:Pius Anyebe
ID: 41812306
I came accross this and it worked fine... Now id like one of my table header Horizontal. How  can i achieve that using your script..
am not good with javascript yet.
thanks
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
Suggested Courses
Course of the Month12 days, 20 hours left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question