(tdInfo: string[][], trInfo: string[], totalHeight: string)
| 91 | }; |
| 92 | |
| 93 | const generateH = (tdInfo: string[][], trInfo: string[], totalHeight: string) => { |
| 94 | const table = SugarElement.fromTag('table'); |
| 95 | Css.set(table, 'height', totalHeight); |
| 96 | const tbody = SugarElement.fromTag('tbody'); |
| 97 | const numRows = tdInfo.length || trInfo.length; |
| 98 | const trows: SugarElement<HTMLTableRowElement>[] = []; |
| 99 | Arr.range(numRows, (r) => { |
| 100 | const tr = SugarElement.fromTag('tr'); |
| 101 | const trHeight = trInfo[r]; |
| 102 | if (Type.isNonNullable(trHeight)) { |
| 103 | Css.set(tr, 'height', trHeight); |
| 104 | } |
| 105 | const numCells = tdInfo[r].length || 1; |
| 106 | const cells: SugarElement<HTMLTableCellElement>[] = []; |
| 107 | Arr.range(numCells, (c) => { |
| 108 | const td = SugarElement.fromTag('td'); |
| 109 | const height = tdInfo[r][c]; |
| 110 | if (Type.isNonNullable(height)) { |
| 111 | Css.set(td, 'height', height); |
| 112 | } |
| 113 | Insert.append(td, SugarElement.fromText(String.fromCharCode('A'.charCodeAt(0) + c) + r)); |
| 114 | cells.push(td); |
| 115 | }); |
| 116 | InsertAll.append(tr, cells); |
| 117 | trows.push(tr); |
| 118 | }); |
| 119 | InsertAll.append(tbody, trows); |
| 120 | Insert.append(table, tbody); |
| 121 | return table; |
| 122 | }; |
| 123 | |
| 124 | const checkWidth = (expected: string[][], table: SugarElement<HTMLTableElement>, newWidth: string) => { |
| 125 | Insert.append(SugarBody.body(), table); |
no test coverage detected
searching dependent graphs…