Home >Web Front-end >HTML Tutorial >2.HTML 表格_html/css_WEB-ITnose

2.HTML 表格_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:33:261131browse

1.表格代码:

<table></table> // 定义表格<tr></tr>   //定义行<td></td> //定义列<th></th> // 定义标题

数据单元格可以包含文本、图片、列表、段落、表单、水平线、表格等等。

2.如果不定义边框属性,表格将不显示边框。有时这很有用,但是大多数时候,我们希望显示边框:

<table border="1"></table>

3.表格表头,通常会显示为黑体居中的效果:

<th></th>

4.表格标题:

<table><caption>Welcome</caption></table>

5.表格的跨行和跨列:

<tr colspan="2"></tr>  //跨两行<td rowspan="2"></td> // 跨两列

6.表格单元格内距:

<table cellspadding="0"></table>

7.表格单元格边距:

<table cellspacing="0"></table>

 

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn