Skip to content

Commit 4a655dc

Browse files
committed
fix: Let the Subject column absorb all leftover table width
1 parent ddc8fe3 commit 4a655dc

2 files changed

Lines changed: 15 additions & 4 deletions

File tree

resources/bone-index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,8 +1302,10 @@ var _setupToggles, _showTogglesIfNeeded;
13021302
(function() {
13031303
var style = document.createElement('style');
13041304
style.textContent =
1305-
/* nth-child(8) = the Subject column */
1306-
'td:nth-child(8) { position: relative; white-space: nowrap; overflow: hidden; max-width: 740px; }' +
1305+
/* nth-child(8) = the Subject column. max-width:0 with the
1306+
width:100% from the page CSS = fluid truncating column: it takes
1307+
all the space the other columns leave, and clips beyond that. */
1308+
'td:nth-child(8) { position: relative; white-space: nowrap; overflow: hidden; max-width: 0; }' +
13071309
'td:nth-child(8).expanded { white-space: normal; overflow: visible; }' +
13081310
'.unfold { position: absolute; right: 0; top: 50%; transform: translateY(-50%);' +
13091311
' cursor: pointer; font-weight: 700; font-size: 1em;' +

scripts/bone-index.clj

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,16 @@
7272
tr.stripe td { background-color: var(--bone-stripe-bg); }
7373
tr:not(.stripe) td { background-color: var(--bone-row-bg); }
7474
td:nth-child(3) { white-space: nowrap; }
75-
td:nth-child(8) { min-width: 740px; } /* Subject */
75+
/* The table always fills the container (even with columns hidden via
76+
--html-columns) and Subject soaks up all the leftover width: the
77+
width:100% td is the greedy column, truncated at its allotted space
78+
by the max-width:0 rule injected from bone-index.js. The 740px
79+
floor lives on the th: putting min-width on the td would clamp its
80+
max-width:0 back up to 740px (CSS 2.1 §10.4) and re-freeze the
81+
column at exactly 740px. */
82+
#reports-table table { width: 100%; }
83+
td:nth-child(8) { width: 100%; } /* Subject */
84+
th:nth-child(8) { min-width: 740px; } /* Subject floor */
7685
td:nth-child(7) { max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* Author */
7786
#status { font-size: 0.8rem; margin-bottom: 0.5rem; }
7887
.row-icon { font-size: 0.75rem; text-decoration: none; }
@@ -96,7 +105,7 @@
96105
}
97106
@media (max-width: 860px) {
98107
td:nth-child(2), th:nth-child(2) { display: none; } /* Priority */
99-
td:nth-child(8) { min-width: auto; } /* Subject */
108+
th:nth-child(8) { min-width: auto; } /* Subject floor */
100109
}
101110
@media (max-width: 780px) {
102111
td:nth-child(5), th:nth-child(5) { display: none; } /* Replies */

0 commit comments

Comments
 (0)