MCPcopy Create free account
hub / github.com/cli-table/cli-table3 / fillInTable

Function fillInTable

src/layout-manager.js:127–153  ·  view source on GitHub ↗
(table)

Source from the content-addressed store, hash-verified

125 }
126
127 function fillInTable(table) {
128 let h_max = maxHeight(table);
129 let w_max = maxWidth(table);
130 debug(`Max rows: ${h_max}; Max cols: ${w_max}`);
131 for (let y = 0; y < h_max; y++) {
132 for (let x = 0; x < w_max; x++) {
133 if (!conflictExists(table, x, y)) {
134 let opts = { x: x, y: y, colSpan: 1, rowSpan: 1 };
135 x++;
136 while (x < w_max && !conflictExists(table, x, y)) {
137 opts.colSpan++;
138 x++;
139 }
140 let y2 = y + 1;
141 while (y2 < h_max && allBlank(table, y2, opts.x, opts.x + opts.colSpan)) {
142 opts.rowSpan++;
143 y2++;
144 }
145 let cell = new Cell(opts);
146 cell.x = opts.x;
147 cell.y = opts.y;
148 warn(`Missing cell at ${cell.y}-${cell.x}.`);
149 insertCell(cell, table[y]);
150 }
151 }
152 }
153 }
154
155 function generateCells(rows) {
156 return rows.map(function (row) {

Callers 2

makeTableLayoutFunction · 0.85

Calls 6

maxHeightFunction · 0.85
maxWidthFunction · 0.85
debugFunction · 0.85
conflictExistsFunction · 0.85
allBlankFunction · 0.85
insertCellFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…