(container: HTMLElement)
| 1020 | |
| 1021 | /** Seed row counts after a full render so incremental patches stay in sync */ |
| 1022 | export function initTableRowCounts(container: HTMLElement): void { |
| 1023 | container.querySelectorAll("table").forEach((table) => { |
| 1024 | const thead = table.querySelector("thead"); |
| 1025 | const tbody = table.querySelector("tbody"); |
| 1026 | table.dataset.shTheadRowCount = String( |
| 1027 | thead |
| 1028 | ? thead.querySelectorAll("tr:not([data-sh-partial])").length |
| 1029 | : 0, |
| 1030 | ); |
| 1031 | table.dataset.shRowCount = String( |
| 1032 | tbody ? countBodyRows(tbody) : 0, |
| 1033 | ); |
| 1034 | table.style.tableLayout = "fixed"; |
| 1035 | table.dataset.shLayoutFixed = "1"; |
| 1036 | }); |
| 1037 | } |
no test coverage detected