(element: HTMLElement)
| 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 |