zoukankan      html  css  js  c++  java
  • HTML高级(表格标签)

    <table></table>

    属性:

    bgcolor:背景色

    border:边框

    bordercolor:边框颜色

    bordercolorlight:边框高亮部分的颜色,border > 1有效

    bordercolordark:边框灰暗部分的颜色,border > 1有效

    cellspacing:单元格间隔

    cellspadding:单元格内容与边框间隔

    width:表格的宽度

    height:表格的高度


    <tr></tr>:创建行

    属性 :

    align:水平对齐

    valign:垂直对齐

    bgcolor:背景色


    <td></td>:创建列

    属性 :

    align:水平对齐

    valign:垂直对齐

    width:宽度

    heigth:高度

    colspan:单元格所占的列数,缺省值为1

    rowspan:单元格所占的行数,缺省值为1

    nowrap:不自动换行

    问题:当表格中内容过长时,表格会被变长。如何解决?


    <th></th>:表头标签(加粗居中)

    <caption></caption>:标题标签


    <table 
    border=1
    bgcolor=red
    bordercolor=blue
    bodercolorlight=green
    bordercolordark=yellow
    cellspacing=20
    cellpadding=50
    width=50%
    height=50%
    align=center
    valign=center>
    <caption>HTML表格</caption>
    
    <tr bgcolor=blue align=center>
    	<th>姓名</th><th>性别</th><th>年龄</th>
    </tr>
    
    <tr>
    	<td>张三</td><td>男</td><td>21</td>
    </tr>
    
    <tr>
    	<td colspan=2>张三</td><td rowspan=2>21</td>
    </tr>
    
    <tr>
    	<td>张三</td><td>男</td>
    </tr>
    
    </table>
    



  • 相关阅读:
    Python strip()方法介绍
    python实现猜拳游戏
    Shopping cart program--python
    转置矩阵的行和列
    Oldman python of full stack-Day2
    根据输入生成二维码
    python 中设置字体/背景颜色
    如何用Notepad++运行python程序
    web前端【第十篇】jQuery基本语法
    web前端【第九篇】JS的DOM对象三
  • 原文地址:https://www.cnblogs.com/wjchang/p/3671570.html
Copyright © 2011-2022 走看看