新程序 发表于 2025-5-26 16:50:35

html创建表格标签

html创建表格标签


<table border="1"> 标签为创建表格,border="1"等于有边框边距,0为无边框

HTML 表格标签
标签      描述
<table>      定义表格
<th>      定义表格的表头
<tr>      定义表格的行
<td>      定义表格单元
<caption>      定义表格标题
<colgroup>      定义表格列的组
<col>      定义用于表格列的属性
<thead>      定义表格的页眉
<tbody>      定义表格的主体
<tfoot>      定义表格的页脚

<td colspan="2">合并2列</td>
<th colspan="3">合并3列的表头</th>

<td rowspan="2">合并2行</td>
<th rowspan="3">合并3行的表头</th>


<!DOCTYPE html>
<html lang="en">
<head>
      <meta charset="UTF-8">
      <title>Document</title>
</head>
<body>
      <table border="1">
<th>星期</th>
<th>项目</th>
<th>流量</th>
<th>安装</th>
<th>充值</th>

<tr>
<td>星期一</td>
<td>百度</td>
<td>5000</td>
<td>2万安装</td>
<td>10万充值</td>

</tr>

<tr>
<td>星期二</td>
<td>抖音</td>
<td>5000</td>
<td>2万安装</td>
<td>10万充值</td>

</tr>

</table>

</body>
</html>

页: [1]
查看完整版本: html创建表格标签