diff --git a/addons/web_editor/static/src/js/backend/convert_inline.js b/addons/web_editor/static/src/js/backend/convert_inline.js index c202a129a8f..3eca5f0c9d3 100644 --- a/addons/web_editor/static/src/js/backend/convert_inline.js +++ b/addons/web_editor/static/src/js/backend/convert_inline.js @@ -309,6 +309,16 @@ function bootstrapToTable(editable) { for (const table of editable.querySelectorAll('table')) { table.removeAttribute('o-temp-width'); } + // Merge tables in tds into one common table, each in its own row. + const tds = [...editable.querySelectorAll('td')] + .filter(td => td.children.length > 1 && [...td.children].every(child => child.nodeName === 'TABLE')) + .reverse(); + for (const td of tds) { + const table = _createTable(); + const trs = [...td.children].map(child => _wrap(child, 'td')).map(wrappedChild => _wrap(wrappedChild, 'tr')); + trs[0].before(table); + table.append(...trs); + } } /** * Convert Bootstrap cards to table structures.