summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Smeding <tom@tomsmeding.com>2023-06-13 10:14:33 +0200
committerTom Smeding <tom@tomsmeding.com>2023-06-13 10:14:33 +0200
commit88c11ef86cd0c4a2a4b273ecf7de150616dfbc82 (patch)
tree86b0cd929e19fa12ebd3638158e5722a91a7dcf2
parent29d26068ad98e865272198090375fca57e5cf156 (diff)
unicode: Invisible spaces between table columns for neat copying
-rw-r--r--modules/unicode/index.html28
1 files changed, 25 insertions, 3 deletions
diff --git a/modules/unicode/index.html b/modules/unicode/index.html
index 8738b6f..781090c 100644
--- a/modules/unicode/index.html
+++ b/modules/unicode/index.html
@@ -11,6 +11,19 @@ body {
.table > div:nth-child(odd) {
background-color: #eee;
}
+.table > div > span {
+ display: inline-block;
+}
+.table > div > span.codepoint {
+ width: 6em;
+ font-weight: bold;
+}
+.table > div > span.symbol {
+ width: 1.5em;
+}
+.table > div > span.space-spacer {
+ width: 1em;
+}
.table {
max-height: 300px;
overflow-y: scroll;
@@ -118,17 +131,26 @@ function makeCodepointDiv(row) {
function populateCodepoint(div, row) {
var span = document.createElement("span");
- span.setAttribute("style", "display: inline-block; width: 7em; font-weight: bold;");
+ span.classList.add("codepoint");
span.appendChild(document.createTextNode("U+" + row[0]));
div.appendChild(span);
span = document.createElement("span");
- span.setAttribute("style", "display: inline-block; width: 2em;");
+ span.classList.add("space-spacer");
+ span.appendChild(document.createTextNode(" "));
+ div.appendChild(span);
+
+ span = document.createElement("span");
+ span.classList.add("symbol");
span.appendChild(document.createTextNode(String.fromCodePoint(parseInt(row[0], 16))));
div.appendChild(span);
span = document.createElement("span");
- span.setAttribute("style", "display: inline-block;");
+ span.classList.add("space-spacer");
+ span.appendChild(document.createTextNode(" "));
+ div.appendChild(span);
+
+ span = document.createElement("span");
span.appendChild(document.createTextNode(row[1]));
div.appendChild(span);
}