tag displays in chrome but not source

后端 未结 1 533
北海茫月
北海茫月 2021-01-26 21:38

In doing some scraping work I keep encountering the tag in the Chrome DevTools inspector, but it doesn\'t appear in the source. For what I hope are ob

1条回答
  •  既然无缘
    2021-01-26 22:06

    The start tag for is optional. That is, you can leave it out, but it is automatically inserted by the browser whenever needed.

    And it is needed, because the rules say you can't have a tr directly in a table. The only children of a table element can be caption, colgroup, thead, tbody and tfoot.
    So, if the browser encounters a tr outside a tbody, it inserts a tbody which the tr will reside in.

    For a more formal way of saying this, see http://www.w3.org/TR/html-markup/tbody.html

    By the way, the very same happens with other start tags, like . If you omit that, writin, say, a

    directly after the , the browser will insert an implied automatically.

    0 讨论(0)
提交回复
热议问题