Skip to content

Commit

Permalink
Reformat adapter-info section.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
greggman committed Jan 17, 2025
1 parent 96faee3 commit 99194a7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
6 changes: 6 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
14 changes: 12 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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:')]),
]),
Expand Down Expand Up @@ -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('* '));
}
}
}
}
Expand Down

0 comments on commit 99194a7

Please sign in to comment.