grapesjs icon indicating copy to clipboard operation
grapesjs copied to clipboard

Table <thead> and <tbody> tag gets Omitted

Open faizansaiyed opened this issue 9 years ago • 6 comments

Hello, There is new issue with GrapesJS (maybe). I've created new component using bm.add() in which I've used a table element with <thead> and <tbody> tags. But when getting html using editor.getHtml() method, the <thead> and <tbody> tags gets ommited. Can you please help?

screenshot from 2017-11-23 10-16-20

screenshot from 2017-11-23 10-14-28

faizansaiyed avatar Nov 23 '17 04:11 faizansaiyed

@fsaiyedOB yeah, I've made the table component like this because at that moment of writing the sorter was acting differently and it was messy ordering rows with tbody-like elements around. Currently, dealing with tables it's not my priority but I'll leave this issue open in case someone else would like to do so

artf avatar Nov 23 '17 21:11 artf

Hi @artf - I can probably take a look at this at some point. I've started by just removing the "Clean table rows from non rows" section in the table component (lines 54-68). Can you point me in the right direction of what problems this causes that need to be addressed?

ryandeba avatar Nov 29 '17 01:11 ryandeba

@ryandeba right start :) The main problem I was facing initially it was with the sorting so, for the rest, I'd probably update the current droppable with just ['tbody', 'thead', 'tfoot'], and create 3 simple components: ComponentTableBody, ComponentTableHead, ComponentTableFoot which basically accept only <tr>s inside and could be dropped only inside <table>s

artf avatar Nov 29 '17 22:11 artf

Thanks! I'll try to get started on this in the next few days.

ryandeba avatar Nov 30 '17 00:11 ryandeba

Merged #606

artf avatar Dec 08 '17 10:12 artf

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] avatar Sep 18 '19 05:09 lock[bot]