HTML

[HTML] HTML / caption / tag to attach caption to table (table)

OOQ 2022. 8. 20. 11:12
728x90
SMALL

#HTML

#caption

HTML / caption / tag to attach caption to table (table)

caption

  • Use the caption tag when captioning your table.
  • The default position is centered above the table.
  • Caption position is set on the caption side of CSS.

example


In order to grasp the position of the caption, the horizontal size of the table was set to 100% and a frame was added.

<!doctype html>
<html lang="en">
  <head>
  <meta charset="utf-8">
    <title>HTML</title>
    <style>
      table { width: 100%; }
      th, td { border: 1px solid #dadada; }
    </style>
  </head>
  <body>
    <table>
      <caption>Table Caption</caption>
      <tr>
        <th>Lorem</th><th>Ipsum</th>
      </tr>
      <tr>
        <td>Dolor</td><td>Amet</td>
      </tr>
    </table>
  </body>
</html>

 

#html caption #tag to attach caption to table

728x90
LIST