diff options
| author | Bobby <[email protected]> | 2022-03-21 05:00:10 -0400 |
|---|---|---|
| committer | Bobby <[email protected]> | 2022-03-21 05:00:10 -0400 |
| commit | 2a37cda2449b625bc49014a63e5bcef8bcab45ff (patch) | |
| tree | 9dfb6299300412f15f21aafe2d1d660d7a122b9d | |
| parent | ea6e14059d8904c83f16ef65dc30dfde70ca78d8 (diff) | |
| download | luciferreeves.github.io-2a37cda2449b625bc49014a63e5bcef8bcab45ff.tar.xz luciferreeves.github.io-2a37cda2449b625bc49014a63e5bcef8bcab45ff.zip | |
Auto add table styles
| -rw-r--r-- | static/assets/js/pages/publish.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/static/assets/js/pages/publish.js b/static/assets/js/pages/publish.js index 7349fac..cc3c9c1 100644 --- a/static/assets/js/pages/publish.js +++ b/static/assets/js/pages/publish.js @@ -8,6 +8,12 @@ window.addEventListener("DOMContentLoaded", () => { }); content.addEventListener("input", () => { renderPreview.innerHTML = marked.parse(content.value); + // Find all tables and add class to them + const tables = document.getElementsByTagName("table"); + for (let i = 0; i < tables.length; i++) { + tables[i].classList.add("table"); + tables[i].classList.add("table-bordered"); + } renderMathInElement(renderPreview, { // customised options // • auto-render specific keys, e.g.: |
