MCPcopy Index your code
hub / github.com/grid-js/gridjs / fromHTMLTable

Method fromHTMLTable

src/header.ts:250–263  ·  view source on GitHub ↗
(element: HTMLElement)

Source from the content-addressed store, hash-verified

248 }
249
250 static fromHTMLTable(element: HTMLElement): Header {
251 const header = new Header();
252 const thead = element.querySelector('thead');
253 const ths = thead.querySelectorAll('th');
254
255 for (const th of ths as any) {
256 header.columns.push({
257 name: th.innerHTML,
258 width: th.width,
259 });
260 }
261
262 return header;
263 }
264
265 /**
266 * Converts the tree-like format of Header to a tabular format

Callers 1

createFromConfigMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected