找回密码
 注册
欢迎访问中国康复治疗师网络联盟
搜索
查看: 8831|回复: 1

[网页] [分享][网页制作]最全的表格代码应用

[复制链接]
发表于 2007-5-11 00:45:09 | 显示全部楼层 |阅读模式
  • 最全的表格代码应用

    1.表格的分隔线可以隐藏
    <table border rules=cols cellspacing=0 align=left> 可以隐藏横向的分隔线
    <table border rules=rows cellspacing=0 align=right>可以隐藏纵向的分隔线
    <table border rules=none cellspacing=0 align=center>可以隐藏横向和纵向的分隔线

    2.表格的边框不断在闪
    以下方法可以令表格的边框不断在闪,很实用的
    在BODY区加上
    <table border="0" width="280" id="myexample"
    style="border:5px solid yellow">
    <tr>
    <td>加入任意的物件.加入任意的物件.
    <br>加入任意的物件.加入任意的物件.
    <br>加入任意的物件.加入任意的物件.</td>
    </tr>
    </table>
    <script language="JavaScript1.2">
    <!--
    function flashit(){
    if (!document.all)
    return
    if (myexample.style.borderColor=="yellow")
    myexample.style.borderColor="lime"
    else
    myexample.style.borderColor="yellow"
    }
    setInterval("flashit()", 500)
    //-->
    </script>

    3.表格分行下载
    这个对表格内容很大比较实用
    在需要分行下载处加上 <tbody >
    比如:
    <table >
    <tbody >
    <tr >
    <td >flsdjfsdjfkdsjf</td >
    </tr >
    <tr >
    <td >skdjfsdjfksd</td >
    </tr >
    </tbody >
    <tbody >
    <tr >
    <td >flsdjfsdjfkdsjf</td >
    </tr >
    <tr >
    <td>skdjfsdjfksd</td >
    </tr >
    </tbody >
    </table >
    4.几种样式不同的表格
    <table border="1" width="220" style="position: absolute; left:
    11; top: 11" height="26" >
    <tr>
    <td width="100%">普通表格</td>
    </tr>
    </table>
    5.正立方表格
    <table border="1" width="220" bordercolorlight="#eeeeee"
    bordercolordark="#000000" style="position: absolute; left: 10; top:
    49" height="26">
    <tr>
    <td width="100%">正立方表格</td>
    </tr>
    </table>

    6.细表格
    <table border="0" frame=vsides width="219"
    bgcolor="#000000" cellspacing="1" cellpadding="0"
    height="22" style="position: absolute; left: 11; top: 86">
    <tr bgcolor="#FFFFFF">
    <td width="100%" height="2">细表格</td>
    </tr>
    </table>
    7.立体表格
    <table border="1" width="220" bordercolorlight="#ffffff"
    bordercolordark="#ffffff" style="position: absolute; left: 10; top:
    112" height="34">
    <tr>
    <td width="100%" bgcolor="#B7B7B7"
    bordercolorlight="#000000" bordercolordark="#eeeeee" >立体表格</td>
    </tr>
    </table>

    8.无名表格  
    <table width="220" align="center" style="position: absolute;
    left: 246; top: 12" height="51">
    <tr>
    <td><fieldset style="width:220" align="center">
    <legend> 无名表格 </legend>  <p align="right"> </fieldset>
    <br>
    </td>
    </tr>
    </table>
    9.表中表效果Ⅱ
    <table width="220" align="center" style="position:
    absolute; left: 245; top: 89" height="110">
    <tr>
    <td height="75"><fieldset style="width:220"
    align="center"> <legend> 表中表效果Ⅱ </legend> <table
    frame="hsides" border="1"
    bordercolorlight="#000000" bordercolordark="#ffffff"
    width="100%" cellspacing="1" cellpadding="0" height="78">
    <tr bgcolor="#ffffff">
    <td width="100%" height="76"></fieldset></td>
    </tr>
    </table>
    10.表中表效果Ⅰ
    <table width="220" align="center" style="position: absolute;
    left: 10; top: 120" height="138" cellspacing="1"
    cellpadding="0">
    <tr>
    <td height="126"><fieldset style="width: 220; color: #B7B7B7;
    border-style: groove" align="center"> <legend style="color:
    #FFFFFF; border: 1 solid #808080" > <font color="#000000">表中表效果Ⅰ</font>
    </legend>  <p align="right"> </fieldset>
    </td>
    </tr>
    </table>

    11.表格中边框的显示

    只显示上边框 <table frame=above>
    只显示下边框 <table frame=below>
    只显示左、右边框 <table frame=vsides>
    只显示上、下边框 <table frame=hsides>
    只显示左边框 <table frame=lhs>
    只显示右边框 <table frame=rhs>
    不显示任何边框 <table frame=void>


    作者:沙鑫 时间:2007-4-22 6:36:28
    2


  • 1. 两种细线表格做法


      源码如下:

    <table width="100%" border="1" bordercolor="#000000">
      <tr bordercolor="#FFFFFF">
        <td>表格边线为1,线色为黑,行线色为白。</td>
      </tr>
    </table>
    <p>
    <table width="100%" border="0" cellspacing="1" bgcolor="#000000">
      <tr>
        <td bgcolor="#FFFFFF">表格边线为0,间距为1,背景色为黑,行背景色为白。</td>
      </tr>
    </table>

      2. 立体表格



      源码如下:

    <table  border=1 cellspacing=0  width=100% bordercolorlight=#333333 bordercolordark=#efefef>
      <tr bgcolor=#cccccc>
        <td>it365cn</td>
        <td>it365cn</td>
        <td>it365cn</td>
        <td>it365cn</td>
      </tr>
      <tr bgcolor=#cccccc>
        <td>cnbruce</td>
        <td>cnbruce</td>
        <td>cnbruce</td>
        <td>cnbruce</td>
      </tr>
    </table>
    <center>表格边线为1,间隔为0,左上为#333333,右下为#efefef,行背景色为#cccccc



      源码如下:

    <table  border=1 cellspacing=0  width=100% bordercolorlight=#333333 bordercolordark=#efefef>
      <tr bgcolor=#cccccc>
        <td>it365cn</td>
        <td>it365cn</td>
        <td>it365cn</td>
        <td>it365cn</td>
      </tr>
      <tr bgcolor=#cccccc>
        <td>cnbruce</td>
        <td>cnbruce</td>
        <td>cnbruce</td>
        <td>cnbruce</td>
      </tr>
    </table>
    <center>表格边线为1,间隔为0,左上为#333333,右下为#efefef,行背景色为#cccccc



      源码如下:

    <table  border=1 cellspacing=0  width=100% bordercolorlight=#333333 bordercolordark=#efefef>
      <tr bgcolor=#cccccc>
        <td>it365cn</td>
        <td>it365cn</td>
        <td>it365cn</td>
        <td>it365cn</td>
      </tr>
      <tr bgcolor=#cccccc>
        <td>cnbruce</td>
        <td>cnbruce</td>
        <td>cnbruce</td>
        <td>cnbruce</td>
      </tr>
    </table>
    <center>表格边线为1,间隔为0,左上为#333333,右下为#efefef,行背景色为#cccccc

    3. 另类圆角表格制作


      源码如下:

    原图:
    <table cellpadding=0 cellspacing=0 border=0 width=282 align=center>
      <tr height=1>
        <td rowspan=4 width=1></td>
        <td rowspan=3 width=1></td>
        <td rowspan=2 width=1></td>
        <td width=2></td>
        <td bgcolor=#43B5C9></td>
        <td width=2></td>
        <td rowspan=2 width=1></td>
        <td rowspan=3 width=1></td>
        <td rowspan=4 width=1></td>
      </tr>
      <tr height=1>
        <td bgcolor=#43B5C9></td>
        <td bgcolor=#43B5C9></td>
        <td bgcolor=#43B5C9></td>
      </tr>
      <tr height=1>
        <td bgcolor=#43B5C9></td>
        <td colspan=3 bgcolor=#43B5C9></td>
        <td bgcolor=#43B5C9></td>
      </tr>
      <tr height=2>
        <td bgcolor=#43B5C9></td>
        <td colspan=5 bgcolor=#43B5C9></td>
        <td bgcolor=#43B5C9></td>
      </tr>
    </table>
    <p>放大
    <table cellpadding=0 cellspacing=0 border=1 width=282 align=center>
      <tr height=10>
        <td rowspan=4 width=10></td>
        <td rowspan=3 width=10></td>
        <td rowspan=2 width=10></td>
        <td width=20></td>
        <td bgcolor=#43B5C9></td>
        <td width=20></td>
        <td rowspan=2 width=10></td>
        <td rowspan=3 width=10></td>
        <td rowspan=4 width=10></td>
      </tr>
      <tr height=10>
        <td bgcolor=#43B5C9></td>
        <td bgcolor=#43B5C9></td>
        <td bgcolor=#43B5C9></td>
      </tr>
      <tr height=10>
        <td bgcolor=#43B5C9></td>
        <td colspan=3 bgcolor=#43B5C9></td>
        <td bgcolor=#43B5C9></td>
      </tr>
      <tr height=20>
        <td bgcolor=#43B5C9></td>
        <td colspan=5 bgcolor=#43B5C9></td>
        <td bgcolor=#43B5C9></td>
      </tr>
    </table>

    4. 虚线边框表格


      源码如下:

    <style type="text/css">
    .tb{BORDER-BOTTOM: #000000 1px dotted;BORDER-top: #000000 1px dotted;BORDER-LEFT:
    #000000 1px dotted;BORDER-RIGHT: #000000 1px dotted;}
    </style>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td class="tb"><center>www.blueidea.com</td>
      </tr>
    </table>
    <p>
    虚线直线1
    <hr size=1 style="border:1px dotted #001403;">
    虚线直线2
    <p size=1 style="border:1px dotted #001403;">

    5. 分类型表格

      源码如下:

    <fieldset>
    <legend>item</legend>
    content
    </fieldset>


    6. 变色的单元格1,通过a:hover做


      源码如下:

    <style>
    a:link,a:visited,a:hover
    {width:100%;text-decoration:none;font-family:verdana;font-size:10px;color:white}
    a:hover{background:#0099ff;color:black}
    td{background:#3366cc;color:white;padding:0px}
    </style>

    <TABLE width=100% cellspacing=1 bgcolor=black >
      <TR>
        <TD><a href="#">Blueidea
        <TD><a href="#">.com
      <TR>
        <TD><a href="#">CNBruce
        <TD><a href="#">.com
    </TABLE>

    7. 变色的单元格2,已经做成了CSS,注意还有透明效果

      源码如下:

    <style type="text/css">
    .aa
    { background-color:#0000ff; color:#ff0000;filter: alpha(opacity=50)}
    .bb 
    { background-color:#3366cc; color:#ffffff}
    </style>

    <table  width="100%">
      <tr>
        <td  onmouseover="this.className='aa'" onmouseout="this.className='bb'"
    class="bb"><center><b>cnbruce</td>
       </tr>
    </table>


    8. 变色的单元格3,通过mouse事件做.有点微软的味道


      源码如下:
    <table width="100%" border="1" cellpadding="3" cellspacing="0"
    bordercolor="#efefef" bgcolor="#efefef">
      <tr>
        <td onMouseOut="this.bgColor='#efefef';this.borderColor='#efefef'";
    onMouseOver="this.bgColor='#cccccc'; this.borderColor='#000033'"><div align="left">
    Blueidea</div></td>
      </tr>
      <tr>
        <td
    onMouseOut="this.bgColor='#efefef';this.borderColor='#efefef'"; onMouseOver="this.bgColor='#cccccc'; this.borderColor='#000033'">
    cnbruce</td>
      </tr>
    </table>

    9. 透明表格

    <table bgcolor=#ececec style="filter:alpha(opacity=50)" width=200 height=100 border=0>
      <tr><td><center>cnbruce</td></tr>
    </table>

    10. 表格边框显示外阴影

      源码如下:

    <table  align=center  width=200  height=100  bgcolor=#f3f3f3
    style="filter:progidXImageTransform.Microsoft.Shadow
    (Color=#333333,Direction=120,strength=5)">
      <tr>
        <td><center>www.cnbruce.com</td>
      </tr>
    </table>

    11. VML代码实现的圆角表格
    (1).

      源码如下:

    <html xmlns:v>
    <style>
    v\:*{behavior:url(#default#VML)}
    </style>
    <body>
       <v:RoundRect style="position:relative;width:150;height:240px">
        <v:shadow on="T" type="single" color="#b3b3b3" offset="3px,3px"/>
        <v:TextBox style="font-size:10.2pt;">VML</v:TextBox>
        </v:RoundRect>
    </body>
    </html>

    (2).

      源码如下:

    <html  xmlns:v>
    <style>
    v\:*{behavior:url(#default#VML)}
    </style>
    <body>
          <v:RoundRect  style="position:relative;width:150;height:240px">
    <v:path  textpathok="true"  />
          <v:textpath  on="true"  string="cnbrucecnbrucecnbrucecnbrucecnbruc
    ecnbrucecnbrucecnbrucecnbrucecnbrucecnbrucecnbrucecnbrucecnbrucecnbruce"  />
            <v:shadow  on="T"  type="single"  color="#b3b3b3"  offset="3px,3px"/>
            <v:TextBox  style="font-size:10.2pt;">VML</v:TextBox>
            </v:RoundRect> 
    </body>
    </html>

    (3).


      源码如下:

    <html xmlns:v>
    <style>
    v\:*{behavior:url(#default#VML)}
    </style>
    <body>
       <v:RoundRect style="position:relative;width:150;height:240px" arcsize=0.5>
        <v:shadow on="T" type="single" color="#b3b3b3" offset="3px,3px"/>
        <v:TextBox style="font-size:10.2pt;">VML</v:TextBox>
        </v:RoundRect>
    </body>
    </html>

  • 回复

    使用道具 举报

     楼主| 发表于 2007-5-11 00:45:33 | 显示全部楼层

    虚线代码

    <hr align="left" width="100%" size="1" style="border-style:dotted; color:#3A3A3A" noshade>

    solid 实线;dotted 点;dash 短线;double 双实线;groove 有立体感的沟槽;ridge 畸形;inset 内嵌一个立方体边框;outset 外嵌一个立方体。

    <hr size=0 style="border:1px dotted #001403;">

    回复 支持 反对

    使用道具 举报

    您需要登录后才可以回帖 登录 | 注册

    本版积分规则

    小黑屋|手机版|【福康盛世 FULLCO.】 ( 蜀ICP备06016978号 )

    康协互通:      ||   || 【2006.6.28~】
    本站内容解释权归福康盛世,未经许可授权不得转载他用!
    站点个人言论只属个人观点,不代表官方观点!如有侵权,请来电来函!
    网络信息不能进行诊断、治疗,如有需要请前往正规医院诊治!
    站点相关内容,仅供学习交流,请勿用于其他商业用途!

    GMT+8, 2024-5-2 07:00 , Processed in 0.093750 second(s), 16 queries .

    Powered by Discuz! X3.5

    © 2001-2023 Discuz! Team.

    快速回复 返回顶部 返回列表