HTMLify

Nested Tables
Views: 147 | Author: cody
<!DOCTYPE html>
<html>

<head>
  <style>
    table {
      border-collapse: collapse;
      width: 100%;
      border: 1px solid #ddd;
    }

    th, td {
      padding: 8px;
      text-align: left;
      border-bottom: 1px solid #ddd;
    }

    th {
      background-color: #f2f2f2;
    }
  </style>
</head>

<body>

  <h2>Nested HTML Tables Example</h2>

  <table>
    <tr>
      <th>Main Table Header 1</th>
      <th>Main Table Header 2</th>
      <th>Main Table Header 3</th>
    </tr>
    <tr>
      <td>
        <table>
          <tr>
            <th>Nested Table Header 1</th>
            <th>Nested Table Header 2</th>
          </tr>
          <tr>
            <td>Nested Table Data 1</td>
            <td>Nested Table Data 2</td>
          </tr>
        </table>
      </td>
      <td>Main Table Data 2</td>
      <td>Main Table Data 3</td>
    </tr>
    <tr>
      <td>Main Table Data 1</td>
      <td>Main Table Data 2</td>
      <td>Main Table Data 3</td>
    </tr>
  </table>

</body>

</html>

Comments