diff --git a/packages-content-model/roosterjs-content-model-editor/lib/modelApi/table/alignTableCell.ts b/packages-content-model/roosterjs-content-model-editor/lib/modelApi/table/alignTableCell.ts index da1fc7bbe92..476bad16d32 100644 --- a/packages-content-model/roosterjs-content-model-editor/lib/modelApi/table/alignTableCell.ts +++ b/packages-content-model/roosterjs-content-model-editor/lib/modelApi/table/alignTableCell.ts @@ -59,6 +59,12 @@ export function alignTableCell( return metadata; }); } + + cell.blocks.forEach(block => { + if (block.blockType === 'Paragraph') { + delete block.format.textAlign; + } + }); } } } diff --git a/packages-content-model/roosterjs-content-model-editor/test/modelApi/table/alignTableCellTest.ts b/packages-content-model/roosterjs-content-model-editor/test/modelApi/table/alignTableCellTest.ts index 1998b3ec256..4b37d305c22 100644 --- a/packages-content-model/roosterjs-content-model-editor/test/modelApi/table/alignTableCellTest.ts +++ b/packages-content-model/roosterjs-content-model-editor/test/modelApi/table/alignTableCellTest.ts @@ -51,6 +51,9 @@ describe('alignTableCell', () => { expect(table.rows[1].cells[0].cachedElement).toEqual({} as any); expect(table.rows[1].cells[1].cachedElement).toBeUndefined(); expect(table.rows[1].cells[2].cachedElement).toBeUndefined(); + table.rows[0].cells[1].blocks.forEach(block => { + expect(block.format.textAlign).toEqual(undefined); + }); } it('empty table', () => {