Tabela Semântica no HTML5

Postado por: Anderson Custódio de Oliveira em

Se você não entente muito a semântica de tabelas recomendo este post.

No HTML5 não precisamos fechar as tags: <tbody>, <thead>, <tfoot>, <tr>, <th>, <td>. Pessoalmente eu gostei, o código ficou bem mais limpo e sem atrapalhar a compreensão.

Exemplo

<table>
    <caption>Alguns super-heróis</caption>
    <thead> <tr> <th>Super-herói <th>Criador <th>Ano
    <tfoot> <tr> <th>Super-herói <th>Criador <th>Ano
    <tbody>
        <tr>
            <th>Batman
            <td>
                Bob Kane <small>(conceito)</small><br>
                Bill Finger <small>(desenvolvedor, não-creditado)</small>
            <td>1939

        <tr> <th>Green Arrow <td>Mort Weisinger<br>George Papp <td>1941
        <tr> <th>Superman <td>Jerry Siegel<br>Joe Shuste <td>1938
</table>

Referencia: W3C Tabular data.

Continuar lendo »