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 41c6c835f35..d9082ca3780 100644 --- a/addons/web_editor/static/src/js/backend/convert_inline.js +++ b/addons/web_editor/static/src/js/backend/convert_inline.js @@ -638,14 +638,14 @@ function addTables($editable) { $(snippet).remove(); // If snippet doesn't have a table as child, wrap its contents in one. - if (!$col.children().filter('table')) { + if (!$col.children().filter('table').length) { const $tableB = _createTable(); $tableB[0].style.width const $rowB = $(''); const $colB = $(''); $rowB.append($colB); $tableB.append($rowB); - for (const child of [...$table[0].childNodes]) { + for (const child of [...$col[0].childNodes]) { $colB.append(child); } $col.append($tableB);