HTML表格创建

时间:2017-02-27 07:01:34

标签: html5

我想使用HTML创建一个如图所示的表格。怎么做? enter image description here

1 个答案:

答案 0 :(得分:1)

用户colspan="3"属性,如果您需要将两个单元格合并为一个。 w3schools

th, td {
  background: #ddd;
  padding: 2px;
}
<table>
  <tr>
    <th>&nbsp;</th>
    <th>9AM</th>
    <th>10AM</th>
    <th>11AM</th>
    <th>12AM</th>
  </tr>
  <tr>
    <td>Mon day</td>
    <td colspan="2">1</td>
    <td>2</td>
    <td>3</td>

  </tr>


  <tr>
    <td>tuesDay</td>
    <td scope="col" colspan="3">&nbsp;</td>
    <!-- The following two cells will appear under the same header -->
    <td>Col 1</td>

  </tr>
</table>