diff --git a/municipal_finance/static/javascript/table.js b/municipal_finance/static/javascript/table.js index f1c2fbd19..f5b75de74 100644 --- a/municipal_finance/static/javascript/table.js +++ b/municipal_finance/static/javascript/table.js @@ -741,6 +741,7 @@ th.setAttribute('colspan', muniColumns * Math.max(functions.length, 1)); th.setAttribute('title', muni.demarcation_code); tr.appendChild(th); + $(tr).addClass('sticky-row'); } // function headings @@ -752,6 +753,7 @@ th.innerText = func.label; th.setAttribute('colspan', cube.columns.length); tr.appendChild(th); + $(tr).addClass('sticky-row'); }); }); } @@ -764,6 +766,7 @@ var th = document.createElement('th'); th.innerText = columns.label; tr.appendChild(th); + $(tr).addClass('sticky-row'); }); }); } diff --git a/municipal_finance/static/stylesheets/table.scss b/municipal_finance/static/stylesheets/table.scss index 87d615110..5892717db 100644 --- a/municipal_finance/static/stylesheets/table.scss +++ b/municipal_finance/static/stylesheets/table.scss @@ -225,12 +225,19 @@ label { .table-scroll-area { overflow: auto; + height:500px; table { float: left; } } + .sticky-row { + position: sticky; + top: 0; + background-color: #f2f2f2; + } + .values { th { font-weight: bold;