zoukankan      html  css  js  c++  java
  • html表格学习-9.22

    1、table标签代表表格

    tr标签代表一行,td标签内数据

    具体格式:<table border="1">       border="1"代表普通边框,border="8" 粗边框,border="15"非常粗的边框

                 <tr>

                 <td>表格内数据1</td>            左侧代表第一行的两行数据

                 <td>表格内数据2</td>

                 </tr>

                 <tr>

                 <td>表格内数据1</td>          左侧代表第二行的两行数据,   显示的表格为两行两列

                 <td>表格内数据2</td>

                 <tr>

                </table>

    注意:不定义边框属性,表格将不显示边框

    2、表头定义:通常使用 <th> 标签进行定义

    <th>表头1</th>

    <th>表头2</th>

    <th>放在tr的外面就表明为整个表格的表头,放在tr里面为表明一行的表头

    3、空表格

    <td></td>表格为空时,边框可能不会被显示出来

    <td>&nbsp;</td> 加上占位符就能显示出边框啦    

    4、表格的标题:<caption>我的标题</caption>

    5、跨行或者跨列的表格单元

    colspan="2" 单元格占两列

    rowspan="2" 单元格占两行
    6、表格内的标签

    表格的单元格可以包含多个段及列表信息

    eg:

    <td>这个单元包含一个表格:
    <table border="1">
    <tr>
    <td>A</td>
    <td>B</td>
    </tr>
    <tr>
    <td>C</td>
    <td>D</td>
    </tr>
    </table>
    </td>

    7、单元格边距及间距

    cellpadding="10" 边距 ,  cellspacing="10"

    8、为表格添加背景颜色或图象

    <table  bgcolor="red"  ,background="F:IMG_20140713_192114.jpg>

    9、为单元格添加背景颜色或图象

    <td bgcolor="blue"  background="F:IMG_20140713_192114.jpg"> 内容</td>

    10、为单元表格排列内容

    align="left"  ,align="right"   内容左对齐或右对齐

    11、框架属性

    frame="box"  ,frame="above" ,frame="below",frame="hsides"

  • 相关阅读:
    JAVA-throw new IOException报错unhandled exception:java.lang.Exception 2021年6月7日
    GIt保持远程 源仓库与Fork仓库同步--2017年6月13日
    Python的getattr()-2017年6月7日
    JavaScript学习-2017年5月18日
    Writing your first Django app--2017年5月9日
    M4-AC6 Oh,Trojan Again--2017年5月9日
    吴军硅谷来信
    【1】Prologue--A Game of Thrones--2017年4月8日
    M4-PC9 Read 10,000 Books,Travel 10,000 Miles--2017年5月8日
    资源分配图RAG的化简
  • 原文地址:https://www.cnblogs.com/xuebaobao/p/3985824.html
Copyright © 2011-2022 走看看