Reputation: 1846
In Word Online I'm seeing tables can be inserted directly after one another in the document without creating a paragraph element between.
The Office JS API in Word Online outputs these as two separate table objects in a table collection. However when the same document is accessed through the Desktop they appear to merge into a single table object.
When viewing the range ooxml, the two tables are formatted as though it is one.
It can be seen by inserting two tables after another in Word, logging the selected range, and looking at the table collections property.
const context = await this.run();
const rangeObject = context.document.getSelection();
rangeObject.load('tables');
await context.sync();
console.log(rangeObject);
Which of these instances is the intended behaviour?
Upvotes: 1
Views: 168
Reputation: 26
This is a known discrepancy in behavior between Word for Windows and Word Online, and as it does not currently cause any particularly bad experiences, Word Online doesn't currently have any solid plans to "fix" this discrepancy. Word Online simply just considers them two different tables.
In the future, if we did feel the need to address this discrepancy in experience, we would likely just align Word Online more closely with the desktop experience by disabling the ability to create a table immediately after another table.
Upvotes: 1