Skip to content

Commit cd92cb1

Browse files
samuelreichertgjulivan
authored andcommitted
fix(rich-text-web): add default border style to inserted tables
1 parent 86f810c commit cd92cb1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/pluggableWidgets/rich-text-web/src/utils/formats/quill-table-better/quill-table-better.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,11 @@ class Table extends Module {
170170
}
171171

172172
insertTable(rows: number, columns: number) {
173+
const baseStyle = "border: 1px solid #000;";
173174
const range = this.quill.getSelection(true);
174175
if (range == null) return;
175176
if (this.isTable(range)) return;
176-
const style = `width: ${CELL_DEFAULT_WIDTH * columns}px`;
177+
const style = `width: ${CELL_DEFAULT_WIDTH * columns}px; ${baseStyle}`;
177178
const formats = this.quill.getFormat(range.index - 1);
178179
const [, offset] = this.quill.getLine(range.index);
179180
const isExtra = !!formats[TableCellBlock.blotName] || offset !== 0;
@@ -189,7 +190,7 @@ class Table extends Module {
189190
return new Array(columns).fill("\n").reduce((memo, text) => {
190191
return memo.insert(text, {
191192
[TableCellBlock.blotName]: cellId(),
192-
[TableCell.blotName]: { "data-row": id, width: `${CELL_DEFAULT_WIDTH}` }
193+
[TableCell.blotName]: { "data-row": id, width: `${CELL_DEFAULT_WIDTH}`, style: baseStyle }
193194
});
194195
}, memo);
195196
}, base);

0 commit comments

Comments
 (0)