Skip to content

Commit bd08359

Browse files
committed
Improve readability of large grid with a lot of data
When a large table is displayed and is larger than the screen size, it is not possible to scroll to see *all* the data. One can zoom-out to have a accomodate more data, but this does not fix the issue as: 1. The displayed data is smaller, making it harder to read it beyond checking the color that represent the state of the metric; 2. Zooming out is limited and at some point more data is still out of sight. This make the table scrollable in its container. Both horizontal and vertical headers stick to their position to make it easier to track what is being viewed.
1 parent d46dd56 commit bd08359

1 file changed

Lines changed: 22 additions & 3 deletions

File tree

lib/riemann/dash/views/css.scss

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,7 @@ h2 {
441441
left: 0;
442442
right: 0;
443443
bottom: 0;
444+
overflow: auto;
444445
}
445446

446447
.bar {
@@ -468,18 +469,36 @@ h2 {
468469

469470
th {
470471
text-align: right;
472+
background-color: #fff;
471473
}
472474

473475
thead {
474476
margin: 0;
475477
padding: 0;
476478

477479
th {
478-
// Work around https://bugs.webkit.org/show_bug.cgi?id=20040
479-
position: relative;
480-
top: 3px;
481480
vertical-align: bottom;
482481
text-align: left;
482+
position: sticky;
483+
top: 0;
484+
z-index: 1;
485+
486+
&:first-child {
487+
left: 0;
488+
z-index: 2;
489+
}
490+
}
491+
}
492+
493+
tbody {
494+
tr:hover, tr:hover th {
495+
background-color: $cream;
496+
}
497+
498+
th {
499+
position: sticky;
500+
left: 0;
501+
z-index: 1;
483502
}
484503
}
485504
}

0 commit comments

Comments
 (0)