Skip to content

Commit a0f67db

Browse files
committed
fix: mpc table markup
1 parent 58de6a0 commit a0f67db

2 files changed

Lines changed: 405 additions & 112 deletions

File tree

‎web/src/App.css‎

Lines changed: 88 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -410,13 +410,39 @@ body {
410410
overflow-x: auto;
411411
border-radius: 6px;
412412
border: 1px solid var(--color-border);
413+
position: relative;
414+
scroll-behavior: smooth;
415+
/* Prettier scrollbar */
416+
scrollbar-width: thin;
417+
scrollbar-color: var(--color-primary) var(--color-bg-card);
418+
}
419+
420+
/* Webkit scrollbar styling */
421+
.mpc-table-container::-webkit-scrollbar {
422+
height: 12px;
423+
}
424+
425+
.mpc-table-container::-webkit-scrollbar-track {
426+
background: var(--color-bg-card);
427+
border-radius: 6px;
428+
}
429+
430+
.mpc-table-container::-webkit-scrollbar-thumb {
431+
background: var(--color-primary);
432+
border-radius: 6px;
433+
border: 2px solid var(--color-bg-card);
434+
}
435+
436+
.mpc-table-container::-webkit-scrollbar-thumb:hover {
437+
background: #3b82f6;
413438
}
414439

415440
.mpc-table {
416441
width: 100%;
417442
border-collapse: collapse;
418443
font-size: 0.7rem;
419-
table-layout: fixed;
444+
table-layout: auto;
445+
white-space: nowrap;
420446
}
421447

422448
.mpc-table thead {
@@ -432,21 +458,64 @@ body {
432458
text-transform: uppercase;
433459
font-size: 0.65rem;
434460
letter-spacing: 0.03em;
461+
white-space: nowrap;
462+
}
463+
464+
/* Date group header (first row) */
465+
.mpc-table thead tr:first-child th:not([rowspan]) {
466+
background-color: rgba(37, 99, 235, 0.3);
467+
border-right: 2px solid var(--color-border);
468+
border-bottom: 1px solid var(--color-border);
469+
font-size: 0.75rem;
470+
font-weight: 700;
471+
padding: 0.6rem 0.5rem;
472+
text-align: center;
473+
}
474+
475+
/* Hour group header (second row) */
476+
.mpc-table thead tr:nth-child(2) th {
477+
background-color: rgba(51, 65, 85, 0.8);
478+
border-right: 1px solid var(--color-border);
479+
border-bottom: 1px solid var(--color-border);
480+
font-size: 0.7rem;
481+
font-weight: 600;
482+
padding: 0.5rem 0.5rem;
483+
text-align: center;
484+
}
485+
486+
/* Minute header (third row) */
487+
.mpc-table thead tr:nth-child(3) th {
488+
background-color: rgba(51, 65, 85, 0.6);
489+
border-right: 1px solid rgba(51, 65, 85, 0.3);
490+
padding: 0.4rem 0.3rem;
491+
font-size: 0.65rem;
492+
font-weight: 500;
493+
}
494+
495+
/* Metric column styling - make it sticky */
496+
.mpc-table tbody th:first-child,
497+
.mpc-table thead th[rowspan] {
498+
min-width: 120px;
499+
text-align: left;
500+
position: sticky;
501+
left: 0;
502+
z-index: 10;
503+
background-color: rgba(30, 41, 59, 0.95);
504+
box-shadow: 2px 0 4px rgba(0, 0, 0, 0.2);
435505
}
436506

437-
.mpc-table th:first-child,
438-
.mpc-table td:first-child {
439-
width: 120px;
507+
/* Data columns - center align */
508+
.mpc-table tbody td {
509+
text-align: center;
510+
padding: 0.4rem 0.3rem;
440511
}
441512

442-
.mpc-table th:not(:first-child),
443-
.mpc-table td:not(:first-child) {
444-
width: 30px;
513+
/* Header columns alignment */
514+
.mpc-table thead th {
445515
text-align: center;
446516
}
447517

448518
.mpc-table td {
449-
padding: 0.4rem 0.5rem;
450519
border-bottom: 1px solid var(--color-border);
451520
color: var(--color-text);
452521
}
@@ -463,15 +532,20 @@ body {
463532
border-bottom: none;
464533
}
465534

466-
/* Forecast data header styling */
467-
.mpc-table thead tr:first-child th {
535+
/* Metric column styling */
536+
.mpc-table thead th[rowspan] {
537+
background-color: rgba(37, 99, 235, 0.2);
468538
vertical-align: middle;
539+
border-right: 2px solid var(--color-border);
540+
font-size: 0.75rem;
541+
text-align: left !important;
469542
}
470543

471-
.mpc-table thead tr:nth-child(2) th {
472-
padding-top: 0.3rem;
473-
padding-bottom: 0.4rem;
474-
font-size: 0.6rem;
544+
/* Additional styling for sticky column in body */
545+
.mpc-table tbody th:first-child {
546+
background-color: rgba(30, 41, 59, 0.95);
547+
text-align: left !important;
548+
border-right: 2px solid var(--color-border);
475549
}
476550

477551
.action-charge,

0 commit comments

Comments
 (0)