We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cad3c03 commit b773573Copy full SHA for b773573
src/components/table.ts
@@ -385,12 +385,16 @@ export class Table extends Component {
385
let string = "";
386
let prevData = "";
387
for (const [j, dataCell] of dataRow.entries()) {
388
- if (j !== 0) string += " ".repeat(headers[j - 1].width - textWidth(prevData) + 1);
+ if (j !== 0) {
389
+ const padding = Math.max(0, headers[j - 1].width - textWidth(prevData) + 1);
390
+ string += " ".repeat(padding);
391
+ }
392
string += dataCell;
393
prevData = dataCell;
394
}
395
- string += " ".repeat(this.rectangle.value.width - textWidth(string) - 2);
396
+ const endPadding = Math.max(0, this.rectangle.value.width - textWidth(string) - 2);
397
+ string += " ".repeat(endPadding);
398
return string;
399
}),
400
rectangle: new Computed(() => {
0 commit comments