Posted By

delibash on 05/11/10


Tagged

javascript


Versions (?)

Make TABLE TH element's innerHTML vertical


 / Published in: JavaScript
 

  1. function vert (elem) {
  2. var el = document.getElementsByTagName(elem);
  3. for (var i=0; i < el.length; i++) {
  4. var ex = el[i].childNodes[0];
  5. if (el[i].nodeType === 1) {
  6. el[i].innerHTML = el[i].innerHTML.split('').join('<br/>');
  7. };
  8. };
  9. }
  10.  
  11. vert('th');

Report this snippet  

You need to login to post a comment.