• html 表格重要属性说明以及使用


    <table> 标签常用属性说明:

    border:表格边框宽度。

    以百分比或者像素指定表格的宽度。

    height:以百分比或者像素指定表格的高度。

    cellspacing:表格中相邻单元格的间距以及单元格外边框与表格边沿之间的间距,一般由css实现。

    cellpadding:单元格的边沿和它的内容的间距,一般由css实现。

    <caption>标签:表示表格的标题

    <tbody>标签:表格主体

    <thead>标签:表格表头

    <tfoot>标签:表格表尾

    <!DOCTYPE html PUBLIC "-//w3c//dtd HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content - Type" content="text/html; charset = UTF-8">
    <title>表格的使用</title>
    </head>
    <body>
    <table border="5" align="center">
      <caption>学生信息表</caption>
      <thead>
         <tr>
    	    <th>学号</th>
    		<th>姓名</th>
    		<th>性别</th>
    	 </tr>
      </thead>
      <tfoot>
         <tr>
    	    <td colspan="3" align="center">
    		这里是表尾
    		</td>
    	 </tr>
      </tfoot>
      <tbody>
         <tr>
    	    <td>0001</td>
    		<td>王明明</td>
    		<td>男</td>
    	 </tr>	 
         <tr>
    	    <td>0002</td>
    		<td>李梅</td>
    		<td>女</td>
    	 </tr>	 
         <tr>
    	    <td>0003</td>
    		<td>张晓丽</td>
    		<td>女</td>
    	 </tr>
      </tbody>
      </table>
    </body>
    </html>

    <td> <th>标签两个重要属性

    colspan:指当前单元格在水平方向跨越的单元格数;

    rowspan:指当前单元格在垂直方向上跨越的单元格数;

    两个属性的值为整数。

    应用:

    <html>
    <head>
    <title>
    cellspacing cellpadding colspan rowspan 属性使用 
    </title>
    </head>
    <body>
    <table border="5" align="center" cellspacing="40" cellpadding ="50">
    <caption>
    学生信息
    </caption>
    <tr>
    <td>
    学号
    </td>
    <td>
    姓名
    </td>
    <td>
    成绩
    </td>
    </tr>
    <tr>
    <td>
    1711421113
    </td>
    <td>
    高春辉
    </td>
    <td>
    100
    </td>
    </tr>
    <tr>
    <td colspan="3" align="center">表尾</td>
    </tr>
    </table>
    </body>
    </html>
  • 相关阅读:
    关于Slowloris HTTP DoS
    [转]更新SDK失败后,出现无法找到SDK location的解决方法
    [吐槽文]一篇课设小结
    无聊时候打打字之百度地图 【更新中】
    git初学 多多指教
    无聊的时候打打字之寒假项目小记录
    机会来了,创业你准备好了吗?
    技术高速发展,IT人员路在何方?
    开发Web应用程序常用优化性能的技巧
    DataTable中存在空值 输出到EXCEL时格式变乱的解决方法【附代码】
  • 原文地址:https://www.cnblogs.com/gaochunhui/p/11053912.html
Copyright © 2020-2023  润新知