From 99194a7a992835229870db2f2248fe909736f37d Mon Sep 17 00:00:00 2001 From: Gregg Tavares Date: Fri, 17 Jan 2025 14:20:00 -0800 Subject: [PATCH] Reformat adapter-info section. The data was in 2 shared columns across all categories. That works for limits (name: limit). For features they use `colspan: 2`. For adapter info though the info is large where as the names are small so they arguably need different formatting. Solved by nesting a table. --- index.html | 6 ++++++ index.js | 14 ++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 29b8d91..13a2a99 100644 --- a/index.html +++ b/index.html @@ -109,6 +109,12 @@ table.misc { min-width: 100%; } +.sub-table { + padding: 0 +} +.sub-table>table { + width: 100%; +} .misc td:nth-child(2) { white-space: pre; } diff --git a/index.js b/index.js index 9c4b2ab..9fcef2c 100644 --- a/index.js +++ b/index.js @@ -355,7 +355,15 @@ async function adapterToElements(adapter) { el('tr', {className: 'section'}, [ el('td', {colSpan: 2}, [createHeading('div', '-', 'adapter info:')]), ]), - ...mapLikeToTableRows(parseAdapterInfo(adapter.info)), + el('tr', {}, [ + el('td', {className: 'sub-table', colSpan: 2}, [ + el('table', {className: 'sub-table'}, [ + el('tbody', {}, [ + ...mapLikeToTableRows(parseAdapterInfo(adapter.info)), + ]), + ]), + ]), + ]), el('tr', {className: 'section'}, [ el('td', {colSpan: 2}, [createHeading('div', '-', 'flags:')]), ]), @@ -708,7 +716,9 @@ function formatSectionForCopyPasteSave({head, rows}) { } if (lastNonEmptyColumn >= 0) { - row.cells[0].prepend(createHidden('* ')); + if (!(row.cells[0].children[0] instanceof HTMLTableElement)) { + row.cells[0].prepend(createHidden('* ')); + } } } }