Skip to content

Commit 2d3514e

Browse files
committed
I think improved sticky table scrolling
1 parent 3b2ee00 commit 2d3514e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/web/css/editor.css

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2281,6 +2281,10 @@ th:last-child, td:last-child {
22812281

22822282
tr:nth-child(even){background-color: var(--table-even-rows-bg)}
22832283

2284+
.replOutput:has(> table.pyret-table) {
2285+
max-height: calc(100vh - 225px); display: block;
2286+
}
2287+
22842288
/* Borders on Pyret table cells */
22852289
table.pyret-table th,
22862290
table.pyret-table td {
@@ -2295,11 +2299,12 @@ table.pyret-table.pyret-matrix {
22952299
}
22962300

22972301

2298-
table.pyret-table { width: 98%; }
2302+
table.pyret-table { width: 98%; overflow: scroll; }
22992303
table.pyret-table thead {
23002304
box-shadow: 0px 2px 2px var(--shadow-color);
2305+
position: sticky;
2306+
top: 0;
23012307
}
2302-
table.pyret-table tr { table-layout: fixed; display: table; width: 100%; }
23032308
/* Force tables to be the full height of the viewport, leaving 225px for other chrome */
23042309
table.pyret-table tbody {
23052310
--bgRGB: 200, 210, 220;
@@ -2308,7 +2313,6 @@ table.pyret-table tbody {
23082313

23092314
--shadow: rgba(41, 50, 56, 0.5);
23102315

2311-
max-height: calc(100vh - 225px); display: block;
23122316
overflow: auto;
23132317

23142318
background:

0 commit comments

Comments
 (0)