Skip to content

Instantly share code, notes, and snippets.

@goldalworming
Created August 31, 2014 04:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goldalworming/3f043be30b3af27b3fd8 to your computer and use it in GitHub Desktop.
Save goldalworming/3f043be30b3af27b3fd8 to your computer and use it in GitHub Desktop.
jquery mengubah table standar dari wysiwyg agar memilki header dan class
$(document).ready(function() {
$('table').addClass('table table-hover course-list-table');
var $t = $("table");
if ($t.has("tbody")) $t.find("tbody").children().unwrap();
$t.find("tr:first").wrap("<thead />").children('td').replaceWith(function(i, html) {
return '<th>' + html + '</th>';
});
$t.find("tr").not(":first").wrapAll("<tbody />");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment