Hacker News new | ask | show | jobs
by dragonwriter 2233 days ago
> won't “<p>one<p>two<p>three<p>four” create four <p> elements nested together?

No, because “A p element's end tag may be omitted if the p element is immediately followed by an address, article, aside, blockquote, details, div, dl, fieldset, figcaption, figure, footer, form, h1, h2, h3, h4, h5, h6, header, hgroup, hr, main, menu, nav, ol, p, pre, section, table, or ul element, or if there is no more content in the parent element and the parent element is an HTML element that is not an a, audio, del, ins, map, noscript, or video element, or an autonomous custom element.” https://html.spec.whatwg.org/multipage/syntax.html#syntax-ta...

1 comments

wow, two things:

1. thanks for the link. that documentation is realllly put together well.

2. for anyone else who goes to the docs, scroll down to the table bit. Official HTML never looked so close to markdown before. But I guess it's legal, with the <td> omissions, etc.

cool stuff!

EDIT: posting code here

  <table>
   <caption>37547 TEE Electric Powered Rail Car Train Functions (Abbreviated)
   <colgroup><col><col><col>
   <thead>
    <tr> <th>Function                              <th>Control Unit     <th>Central Station
   <tbody>
    <tr> <td>Headlights                            <td>                <td>y
    <tr> <td>Interior Lights                       <td>x               <td>y
    <tr> <td>Electric locomotive operating sounds  <td>                <td>
    <tr> <td>Engineer's cab lighting               <td>x               <td>z
    <tr> <td>Station Announcements - Swiss         <td>x               <td>y
  </table>