Google analytics script

Latest jQuery CDN with code tiggling.

Showing posts with label Browser Compatibility. Show all posts
Showing posts with label Browser Compatibility. Show all posts

Tuesday, 2 August 2011

Cross browser headers with vertical rotated text

You've probably come across the problem of displaying these kind of tables:

  • many columns
  • header column at the top
  • content cells display narrow data - flags (yes/no, true/false, y/n, on/off, finite states like yes/no/maybe etc.) or just icons that denote some sort of state as in feature list tables where each cell displays either a check-mark or nothing or green and empty cirles or similar...
  • header cells contain much wider data than content cells - more words that take much valuable horizontal space
If you had to display these kind of tables you've probably been thinking how could you make header cells narrower but not clip their content so headers still make sense... The idea is to display header cells as tall cells with vertically displayed text so columns can stay narrow as their content cells need. This way our tables get horizontally usable and don't take much space. It's true that header row becomes higher (depending on the amount fo text that you'd like to display, but hey there's just one header row in the whole table.

Anyway. So if you did struggle with this and also wanted it to display approximately the same on all three major nowadays browsers than you did spend some time solving it. If you didn't but you think you may in the future, then just use the code I'll provide here and off you go.