From 88c11ef86cd0c4a2a4b273ecf7de150616dfbc82 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Tue, 13 Jun 2023 10:14:33 +0200 Subject: unicode: Invisible spaces between table columns for neat copying --- modules/unicode/index.html | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) (limited to 'modules/unicode/index.html') 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); } -- cgit v1.2.3-70-g09d2