style tables after the fact
This commit is contained in:
1 parent
025699cd01
commit
6dc2b218c7
1 file changed
+19
@@ -92,5 +92,24 @@
|
|||||||
<p>© 2013 Dokku</p>
|
<p>© 2013 Dokku</p>
|
||||||
</footer>
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
|
<script>
|
||||||
|
document.addEventListener("DOMContentLoaded", function (e) {
|
||||||
|
var elements = document.querySelectorAll('table'),
|
||||||
|
classNames = ['table', 'table-striped', 'table-hover', 'table-condensed'],
|
||||||
|
addClass = function (el, className) {
|
||||||
|
if (el.classList) {
|
||||||
|
el.classList.add(className);
|
||||||
|
} else {
|
||||||
|
el.className += ' ' + className;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Array.prototype.forEach.call(classNames, function (className, i) {
|
||||||
|
Array.prototype.forEach.call(elements, function (el, i) {
|
||||||
|
addClass(el, className);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
Reference in new issue
Block a user