aboutsummaryrefslogtreecommitdiffstats
path: root/tests/html/fixed_table_2.html
blob: 0a5d28d6ad6ac8286259dcb3fb39ca6124814247 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<!-- This test creates one table, one caption, three rows, three header cells, and five data cells.
     The table uses the fixed table layout algorithm and the table's width specified to 600px.
     Each column's width will be assigned according to their ratio of column's widths
     which are defined in col elements.
     And table, caption, td, th elements have border. -->
<!DOCTYPE html>
<html>
  <head>
    <title>Fixed Table</title>
    <style>
      table {
        table-layout: fixed;
        width: 600px;
        border: solid black 2px;
      }
      caption { border: solid blue 1px; }
      td { border: solid red 1px; }
      th { border: solid red 1px; }
    </style>
  </head>
  <body>
    <table>
        <caption>This is a 3x3 fixed table</caption>
        <colgroup>
          <col style="width: 10px" />
          <col style="width: 20px" />
          <col style="width: 30px" />
        </colgroup>
        <tbody>
          <tr><th style="width: 100px">Header 1</th><td style="width: 100px">Cell 1</td><td>Cell 2</td></tr>
          <tr><th style="width: 300px">Header 2</th><td style="width: 300px">Cell 3</th><td>Cell 4</td></tr>
          <tr><th>Header 3</th><td>Cell 5</th></tr>
        </tbody>
    </table>
  </body>
<html>