html网页中怎么设置表格中的表头

 2022-03-10    546  

实例说明:

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>小白教程</title> 
</head>
<body>
<h4>水平标题:</h4>
<table border="1">
<tr>
  <th>姓名</th>
  <th>语文成绩</th>
  <th>数学成绩</th>
</tr>
<tr>
  <td>小明</td>
  <td>90</td>
  <td>95</td>
</tr>
</table>
<h4>垂直标题:</h4>
<table border="1">
<tr>
  <th>姓名</th>
  <td>小明</td>
</tr>
<tr>
  <th>数学成绩</th>
  <td>95</td>
</tr>
<tr>
  <th>语文成绩</th>
  <td>90</td>
</tr>
</table>
</body>
</html>

标签含义:

<table>定义表格

<th>定义表格的表头

<tr>  定义表格的行

<td>定义表格单元

源代码运行结果如下:

QQ截图20220310150937.png

  •  标签:  
  • html
  •  

原文链接:https://77isp.com/post/318.html

=========================================

https://77isp.com/ 为 “云服务器技术网” 唯一官方服务平台,请勿相信其他任何渠道。