Difference between revisions of "Complex Tables Favlet"

From Level Access Web Labs
Jump to navigation Jump to search
(Created page with "<html> <a href="javascript:(function(){ var el = document.querySelectorAll('td, th'); var str; var headers=[]; var sentinel; if (el.length>0) { for (var i=0; i<el.lengt...")
 
Line 1: Line 1:
<html>
+
<a href="javascript:void((function(){var%20element=document.createElement('script');element.setAttribute('src','complex tables.js');document.body.appendChild(element)})());"> Complex Tables Favlet </a>
<a href="javascript:(function(){
 
 
 
var el = document.querySelectorAll('td, th');
 
 
 
var str;
 
var headers=[];
 
var sentinel;
 
 
 
if (el.length>0) {
 
for (var i=0; i<el.length; i++) {
 
if (el.item(i).hasAttribute('headers')) {
 
str = el.item(i).getAttribute('headers');
 
headers = str.split(' ');
 
for (var ii=0; ii < headers.length; ii++) {
 
if (document.getElementById(headers[ii])) {
 
sentinel = 1;
 
s = document.createElement('Span');
 
t = document.createTextNode(document.getElementById(headers[ii]).textContent+" ");
 
s.appendChild(t);
 
s.style.backgroundColor = 'antiqueWhite';
 
s.style.color = 'black';
 
el.item(i).appendChild(s);
 
}
 
}
 
 
 
}
 
str='';
 
header='';
 
t='';
 
}
 
if (!sentinel) {
 
  alert('no valid headers found');
 
}
 
}
 
else {
 
  alert('No table cells found');
 
}
 
 
 
})();"> Complex Tables Favlet </a>
 
</html>
 

Revision as of 22:02, 3 February 2014

<a href="javascript:void((function(){var%20element=document.createElement('script');element.setAttribute('src','complex tables.js');document.body.appendChild(element)})());"> Complex Tables Favlet </a>