Menu

#145 TD being allowed without TR as parent

v2.30
open
nobody
td (1)
5
2023-06-19
2015-07-28
David
No

I have HTML with an open TD tag out of place nested inside content of another TD. I would have expected the cleaner to remove the extra TD or else end the current TD and start a new one. Instead, it leaves the TD in the random invalid spot. Here is a simplified input HTML that shows the problem.

<table>
    <tr>
        <td>
            <div>
                <td>
            </div>
        </td>
    </tr>
</table>

And the cleaner make it:

<table>
   <tbody>
      <tr>
         <td>
            <div>
               <td>
               </td>
            </div>
         </td>
      </tr>
   </tbody>
</table>

Discussion

  • David

    David - 2015-07-29

    For what it's worth, it looks like most browsers will end the previous TD tag (and nested tags that aren't yet closed) and make the unexpected new TD tag a direct child of the row.

     
  • Scott Wilson

    Scott Wilson - 2015-08-10

    That does look odd; you shouldn't have a TD as a child of a DIV. I guess its going by the fact its within an open table/tr. I'll add a test and see if I can fix this one.

     
  • Scott Wilson

    Scott Wilson - 2015-08-24
    • Group: v2.13 --> v2.14
     
  • Scott Wilson

    Scott Wilson - 2015-08-24
    • Group: v2.14 --> v2.15
     
  • Scott Wilson

    Scott Wilson - 2015-10-01
    • Group: v2.15 --> v2.16
     
  • Scott Wilson

    Scott Wilson - 2015-11-20
    • Group: v2.16 --> v2.17
     
  • Scott Wilson

    Scott Wilson - 2016-10-19
    • Group: v2.17 --> v2.18
     
  • Scott Wilson

    Scott Wilson - 2017-02-06
    • Group: v2.18 --> v2.19
     
  • Scott Wilson

    Scott Wilson - 2017-02-07
    • Group: v2.19 --> v2.20
     
  • Scott Wilson

    Scott Wilson - 2017-05-02
    • Group: v2.20 --> v2.21
     
  • Scott Wilson

    Scott Wilson - 2017-05-11
    • Group: v2.21 --> v2.22
     
  • Scott Wilson

    Scott Wilson - 2018-04-24
    • Group: v2.22 --> v2.23
     
  • Scott Wilson

    Scott Wilson - 2019-09-04
    • Group: v2.23 --> v2.24
     
  • Scott Wilson

    Scott Wilson - 2020-04-29
    • Group: v2.24 --> v2.25
     
  • Scott Wilson

    Scott Wilson - 2021-09-24
    • Group: v2.25 --> v2.26
     
  • Scott Wilson

    Scott Wilson - 2023-04-29
    • Group: v2.26 --> v2.29
     
  • Scott Wilson

    Scott Wilson - 2023-06-19
    • Group: v2.29 --> v2.30
     

Log in to post a comment.