CDE
This commit is contained in:
parent
518da4a923
commit
764da6cbbb
6144 changed files with 83610 additions and 11 deletions
|
|
@ -0,0 +1,20 @@
|
|||
function csv_to_table(s) {
|
||||
function ce(t) { return document.createElement(t); }
|
||||
function ap(t) { document.body.appendChild(t); }
|
||||
var t = ce('table'), f = 0; //1;
|
||||
s.split('\n').map(function(l) {
|
||||
var r = ce(f ? 'tr': 'thead');
|
||||
l.split(',').map(function (w) {
|
||||
var c = ce(f ? 'td' : 'th');
|
||||
c.textContent = w;
|
||||
r.appendChild(c);
|
||||
});
|
||||
t.appendChild(r);
|
||||
f = 1; //0;
|
||||
});
|
||||
//return t.innerHTML;
|
||||
return t.outerHTML;
|
||||
}
|
||||
/*
|
||||
but also with this changes is very dependent by javascript engine and/or browser version (in: IE>=9, chrome )
|
||||
*/
|
||||
Loading…
Add table
Add a link
Reference in a new issue