开发者

HTML 2x2 table: I want the first row is not divided in two parts

I have an HTML table 2x2.

开发者_StackOverflow社区In that table, I want the first row is not divided in two parts but only has one cell that occupies the full width of the table.

-------
|     |
-------
|  |  |
-------

How can I do that?


Try the colspan attribute.


Use the colspan table cell attribute like this.

<table>
 <tr>
   <th colspan="2"></th>
 </tr>
 <tr>
   <td></td>
   <td></td>
 </tr>
</table>


OK, i should use <th>.


<table>
 <tr>
   <td colspan = 2></td>
 </tr>
 <tr>
   <td></td>
   <td></td>
 </tr>
</table>


Use colspan along with <th> for the header row

  <table>
    <tr>
      <th colspan="2"></th>
    </tr>
    <tr>
      <td></td>
      <td></td>
    </tr>
  </table>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜