fix: make BOQ sticky header actually stick during scroll
This commit is contained in:
@@ -13,7 +13,25 @@
|
||||
.boq-table { table-layout: fixed; width: 100%; }
|
||||
.boq-table td, .boq-table th { overflow-wrap: anywhere; }
|
||||
.boq-table .money-value { white-space: nowrap; overflow-wrap: normal; }
|
||||
.boq-table thead th { position: sticky; top: 0; z-index: 10; background: #f8f9fa; }
|
||||
/*
|
||||
* Sticky header requires its own scrollport. Bootstrap .table-responsive
|
||||
* (overflow-x: auto) forces overflow-y to auto and creates a container
|
||||
* that does not scroll vertically, so position:sticky never sticks to the page.
|
||||
* This wrapper scrolls both axes; thead th sticks to its top.
|
||||
*/
|
||||
.boq-table-wrap {
|
||||
max-height: calc(100vh - 12rem);
|
||||
overflow: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
.boq-table thead th {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 10;
|
||||
background-color: #f8f9fa;
|
||||
/* border-collapse: drop sticky borders — restore with box-shadow */
|
||||
box-shadow: inset 0 -1px 0 #dee2e6;
|
||||
}
|
||||
.toggle-row { cursor: pointer; user-select: none; }
|
||||
.toggle-row .toggle-icon { display: inline-block; width: 1.2em; transition: transform 0.15s; }
|
||||
.toggle-row.collapsed .toggle-icon { transform: rotate(-90deg); }
|
||||
@@ -51,7 +69,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
<div class="boq-table-wrap">
|
||||
<table class="table table-bordered table-sm align-middle boq-table">
|
||||
<colgroup>
|
||||
<col style="width: 3.5rem">
|
||||
|
||||
Reference in New Issue
Block a user