Suzuki Stumpy Posted March 4, 2023 Clone Share Posted March 4, 2023 Just noticed this one. Working on a character sheet template and have a table within a fieldset that's within another fieldset. All looks OK on the saved post: but, when I go to edit the saved post, the first row of the Impacts table just collapses in on itself: ... and looking at the source, it has indeed taken that first row of the table and pulled it out to a top level <p> element, leaving the blank first row of the table in place. Not sure if it's because the first row was marked as containing headers in the table dialog or not, that's my next thing to test. <hr> <div style="text-align:center;"> <strong>IMPACTS</strong> </div> <div> <fieldset class="mw-fieldset"> <legend class="mw-fieldset-legend"></legend> <div class="mw-fieldset-body"> <p> <span style=""><strong>MISFORTUNES</strong></span><span style=""><strong>LASTING EFFECTS</strong></span><span style=""><strong>BURDENS</strong></span><span style=""><strong>CURRENT VEHICLE</strong></span> </p> <table border="1" cellpadding="0" cellspacing="0" style="width:100%;"> <tbody> <tr> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> </tbody> </table> <p> </p> </div> </fieldset> <p> Link to comment Share on other sites More sharing options...
Suzuki Stumpy Posted March 4, 2023 Author Clone Share Posted March 4, 2023 Yep, looks as though it could be because I'd flagged the first row as a header rather than a data row in the table dialog. If I recreate using regular cells then it all seems to work. Link to comment Share on other sites More sharing options...
Eric Posted March 4, 2023 Clone Share Posted March 4, 2023 Can you show me what the intended source should be? I am pretty sure it's an issue with allowed content rules, just need to know which one is getting in the way. Link to comment Share on other sites More sharing options...
Suzuki Stumpy Posted March 4, 2023 Author Clone Share Posted March 4, 2023 Right, this is the source that's generated by the table editor (no manual source editing done) it fails because the <th> cells are embedded within the <tbody> tags instead of within a <thead> section. <table align="center" border="1" cellpadding="1" cellspacing="1" style="width: 50%;"> <tbody> <tr> <th> Test Header 1 </th> <th> Test Header 2 </th> <th> Test Header 3 </th> </tr> <tr> <td> blah </td> <td> blah </td> <td> blah </td> </tr> </tbody> </table> what it should be generating is: <table align="center" border="1" cellpadding="1" cellspacing="1" style="width: 50%;"> <thead> <tr> <th> Test Header 1 </th> <th> Test Header 2 </th> <th> Test Header 3 </th> </tr> </thead> <tbody> <tr> <td> blah </td> <td> blah </td> <td> blah </td> </tr> </tbody> </table> To replicate, create a table, then select the cells in the first row. Ctrl-Right click to bring up the edit widget, select Cell > Cell Properties and set the cell type to 'Header' Link to comment Share on other sites More sharing options...
Eric Posted March 5, 2023 Clone Share Posted March 5, 2023 th is allowed within any tr by the spec, so it's probably something about the specific stack. Will look at it. Link to comment Share on other sites More sharing options...
Eric Posted April 10, 2023 Clone Share Posted April 10, 2023 @Suzuki Stumpy After looking at this in some detail, the use of th tags doesn't offer much benefit other than implied styling. The most straightforward fix will be to remove the Headers and Cell Type dropdowns from the dialog boxes, so all cells are treated equally and don't cause one or the other sets of style rules to be violated. I don't see a huge downside since most of our table users are setting their own styles (as you did in your example) and aren't really using th for tabular data. Link to comment Share on other sites More sharing options...
Suzuki Stumpy Posted April 11, 2023 Author Clone Share Posted April 11, 2023 Makes sense. Thanks Eric. Link to comment Share on other sites More sharing options...
Recommended Posts