MCPcopy Index your code
hub / github.com/Alphanimble/htmlstream / initTableRowCounts

Function initTableRowCounts

src/patch-streaming-html.ts:1022–1037  ·  view source on GitHub ↗
(container: HTMLElement)

Source from the content-addressed store, hash-verified

1020
1021/** Seed row counts after a full render so incremental patches stay in sync */
1022export 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}

Callers 2

seedTableCountsFunction · 0.90

Calls 1

countBodyRowsFunction · 0.85

Tested by

no test coverage detected