zoukankan      html  css  js  c++  java
  • 各种表格样式代码

    隐藏横向的分隔线:
    <table border rules=cols cellspacing=0 align=left> 
     
      例一:
         
         
         


    ■隐藏纵向的分隔线
    <table border rules=rows cellspacing=0 align=right>

    例二:

         
         
         


    ■隐藏横向和纵向分隔线
    <table border rules=none cellspacing=0 align=center>

    例三:

         
         
         



    ■表格边框连续闪烁
    在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>
    <language=javascript1.2>

         
         
         


    ■表格分行下载(内容很大、比较实用)
    在需要分行下载处加上 <tbody >,例:
    <table >
    <tbody >
    <tr >
    <td >麦迪天神1</td >
    </tr >
    <tr >
    <td >麦迪天神2</td >
    </tr >
    </tbody >

    <tbody >
    <tr >
    <td >麦迪天神3</td >
    </tr >
    <tr >
    <td>麦迪天神4</td >
    </tr >
    </tbody >
    </table >

    ■普通表格 <table border="1" width="220" style="position: absolute; left:
    11; top: 11" height="26" >
    <tr><td width="100%">普通表格</td></tr></table>

     

    普通表格


    ■正立方表格

    <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>

    正立方表格





    ■细表格
    <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>

     

    细表格




    ■立体表格
    <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>

    立体表格





    ■无名表格

    <table width="220" align="center" style="position: absolute;
    left: 246; top: 12" height="51">
    <tr>
    <td><fieldset style="220" align="center">
    <legend> 无名表格 </legend>  <p align="right"> </fieldset>
    <br>
    </td>
    </tr>
    </table>

     





    无名表格 

     

    ■表中表效果Ⅰ

    <table width="220" align="center" style="position: absolute;
    left: 10; top: 120" height="138" cellspacing="1"
    cellpadding="0">
    <tr>
    <td height="126"><fieldset style=" 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>







     

    ■表中表效果Ⅱ

    <table width="220" align="center" style="position:
    absolute; left: 245; top: 89" height="110">
    <tr>
    <td height="75"><fieldset style="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>

    表中表效果Ⅰ 

     

     

    表中表效果Ⅱ


    ■表格中边框的显示

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

    -----------------------------
    ■虚线表格代码:
    ------------------------------
    <TABLE style="BORDER-RIGHT: 1px dotted; BORDER-TOP: 1px dotted; BORDER-LEFT: 1px dotted; BORDER-BOTTOM: 1px dotted; BORDER-COLLAPSE: collapse" borderColor=#c0c0c0 cellSpacing=0 cellPadding=0 width=362 border=0>
    <TBODY>
    <TR>
    <TD width=362></TD></TR></TBODY></TABLE>



    要把表格作的精致,需要修改相应表格属性参数的大小:

    表格属性:

    <table width=? hight=? border=? bordercolor=? cellspacing=? cellpadding=?><tr><td></td></tr></table>

    table:表格标记 tr:行标记 td:单元格标记

    bgcolor(背景色) background (背景图象) cellspacing(设置单元格间距) cellpadding(单元格边距,即内容与边框间的距离) align(对齐方式:分为居左(left),居中(center),居右(right))

    frame外部边框样式 :

    void(不显示边框) Vsides(显示左右边框) Hsides(显示上下边框) Border(显示上下左右边框) above(显示上边框) below(显示下边框) Lhs(显示左边框) Rhs(显示右边框)

    rules 内部边框样式:

    All(显示所有内部边框) Cols(仅显示行边框) Rows(仅显示列边框) Groups(显示介于行列之间的边框) None(不显示内部边框)

    bordercolorlight(亮边框颜色) bordercolordark(暗边框颜色)

    单元格边框的隐藏

    隐藏右边框 隐藏左边框
    隐藏上边框 隐藏下边框


    代码如下:

    <table width="244" border="1" cellpadding="2" cellspacing="3" bordercolor="#FF9966" >
    <tr>
    <td width="102" style="border-right-style:none">隐藏右边框</td>
    <td width="119" style="border-left-style:none">隐藏左边框</td>
    </tr>
    <tr>
    <td style="border-top-style:none">隐藏上边框</td>
    <td style="border-bottom-style:none">隐藏下边框</td>
    </tr>
    </table>



    1.样式一 立体表格(1)

         
         

    代码如下:
    <table width="200" border="1" cellpadding="1" cellspacing="3" bordercolor="#ffffff" bgcolor="#FF9966" borderColorLight=#000000>
    <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    </tr>
    </table>

    2.样式二 立体表格样式(2)

         
         

    <table width="200" border="1" cellpadding="1" cellspacing="3" bordercolor="#ffffff" bgcolor="#FF9966" borderColordark=#000000>
    <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    </tr>
    </table>

    3.样式三 立体表格样式(3)

       
       

    <table border=1 cellspacing=0 width=44% bordercolorlight=#333333 bordercolordark=#efefef>
    <tr bgcolor=#cccccc>
    <td width="50%" bgcolor="#FF9966">&nbsp;</td>
    <td width="50%" bgcolor="#FF9966"><font color="#ff0000" face="隶书">&nbsp;</font></td>
    </tr>
    <tr bgcolor=#cccccc>
    <td bgcolor="#FF9966"><font color="#ff0000" face="隶书">&nbsp;</font></td>
    <td bgcolor="#FF9966"><font color="#ff0000" face="隶书">&nbsp;</font></td>
    </tr>
    </table>

    4.样式四 立体表格(4)

     
     

    <TABLE cellSpacing=0 cellPadding=0 width=200 border=1>
    <TBODY>
    <TR>
    <TD bgcolor="#FF9966">&nbsp;</TD>
    </TR>
    <TR>
    <TD bgcolor="#FF9966">&nbsp;</TD>
    </TR>
    </TBODY>
    </TABLE>

    5.样式五 颜色表格

    麦迪天神  
       





    <TABLE height=48 cellSpacing=1 borderColorDark=#ffffff cellPadding=1
    width=309 align=left borderColorLight=#ffffff border=1>
    <TBODY>
    <TR>
    <TR align=center>
    <TD borderColorLight=#000000 width=178
    bgColor=#FF9966 borderColorDark=#eeeeee height=24>写入字</TD>
    <TD borderColorLight=#000000 width=181 bgColor=#FF6666
    borderColorDark=#eeeeee>&nbsp;</TD>
    </TR>
    <TR align=center>
    <TD borderColorLight=#000000 bgColor=#6699FF
    borderColorDark=#eeeeee height=24>&nbsp;写入字</TD>
    <TD borderColorLight=#000000 bgColor=#33CC33
    borderColorDark=#eeeeee>&nbsp;</TD>
    </TR>
    </TBODY>
    </TABLE><br>
    6.样式六 空心表格
         
         
         

    代码如下:

    <table width="200" border="1" cellpadding="1" cellspacing="3" bordercolor="#66ccff">
    <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    </tr>
    </table>
    7.样式七 圆角表格

    <TABLE style="TABLE-LAYOUT: fixed" height=28 cellSpacing=0 cellPadding=0 width="45%" border=0>
    <TBODY>
    <TR height=3 width="100%">
    <TD> <TABLE style="TABLE-LAYOUT: fixed" height=3 cellSpacing=0 cellPadding=0 width="100%" border=0>
    <TBODY>
    <TR height=1>
    <TD width=1></TD>
    <TD width=1></TD>
    <TD width=1></TD>
    <TD bgColor=#908a47></TD>
    <TD width=1></TD>
    <TD width=1></TD>
    <TD width=1></TD>
    </TR>
    <TR height=1>
    <TD></TD>
    <TD bgColor=#908a47 colSpan=2></TD>
    <TD bgColor=#f7f8f9></TD>
    <TD bgColor=#908a47 colSpan=2></TD>
    <TD></TD>
    </TR>
    <TR height=1>
    <TD></TD>
    <TD bgColor=#908a47></TD>
    <TD bgColor=#f7f8f9 colSpan=3></TD>
    <TD bgColor=#908a47></TD>
    <TD></TD>
    </TR>
    </TBODY>
    </TABLE></TD>
    </TR>
    <TR>
    <TD> <TABLE style="TABLE-LAYOUT: fixed" height="100%" cellSpacing=0 cellPadding=0 border=0>
    <TBODY>
    <TR>
    <TD width=1 bgColor=#908a47></TD>
    <TD id=oINNER bgColor=#f7f8f9> </TD>
    <TD width=1 bgColor=#908a47></TD>
    </TR>
    </TBODY>
    </TABLE></TD>
    </TR>
    <TR height=3 width="100%">
    <TD> <TABLE style="TABLE-LAYOUT: fixed" height=3 cellSpacing=0 cellPadding=0 width="100%" border=0>
    <TBODY>
    <TR height=1>
    <TD width=1></TD>
    <TD width=1 bgColor=#908a47></TD>
    <TD width=1 bgColor=#f7f8f9></TD>
    <TD bgColor=#f7f8f9></TD>
    <TD width=1 bgColor=#f7f8f9></TD>
    <TD width=1 bgColor=#908a47></TD>
    <TD width=1></TD>
    </TR>
    <TR height=1>
    <TD></TD>
    <TD bgColor=#908a47 colSpan=2></TD>
    <TD bgColor=#f7f8f9></TD>
    <TD bgColor=#908a47 colSpan=2></TD>
    <TD></TD>
    </TR>
    <TR height=1>
    <TD colSpan=3></TD>
    <TD bgColor=#908a47></TD>
    <TD colSpan=3></TD>
    </TR>
    </TBODY>
    </TABLE></TD>
    </TR>
    </TBODY>
    </TABLE>
    8.样式八 阴影表格
     








    <table width=238 height=100 align=left bordercolor="#FF9966" bgcolor=#f3f3f3
    style="filter:progid:DXImageTransform.Microsoft.Shadow
    (Color=#333333,Direction=120,strength=5)">
    <tr>
    <td width="230" bgcolor="#FF9966"><center>
    <a href="http://www.toto369.net" target="_blank">写入字</a>
    </center></td>
    </tr>
    </table>
    </SPAN><br>
    <br><br><br><br>

    9.样式九 透明表格
         

    代码如下:
    <table width="200" border="1" cellpadding="1" cellspacing="3" bordercolor="#ffffff" bgcolor="#66ccff" borderColorLight=#000000 style="FILTER:alpha(opacity=10)">
    <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    </tr>
    </table>

    10、样式十 无边框表格

         
         
         

    <table width="200" border="1" cellpadding="0" cellspacing="0" bordercolor="#FF9966" frame=void>
    <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    </tr>
    <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    </tr>
    <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td bordercolor="#FF9966">&nbsp;</td>
    </tr>
    </table>

    说明:边框主要由frame值确定,void:不显示边框, adove:只显示上边框。below:只显示下边框。hsiders:显示左右边框。rhs:显示右边框。chs:显示左边框。rsides:显示上下边框

    11.样式十一 三角表格

    <table border="30" cellspacing="0" cellpadding="0" bordercolorlight="#ff9966" bordercolordark="#00000">
    <tr>
    <td></td>
    </tr>
    </table>

    <table border="30" cellspacing="0" cellpadding="0" bordercolorlight="#ff9966" bordercolordark="#ffffff">
    <tr>
    <td></td>
    </tr>
    </table>

    11111111111
    <table width="151" height="107" border="100" cellpadding="0" cellspacing="0" bordercolorlight="#ff0000" bordercolordark="#ffffff">
    <tr>
    <td width="21" height="2" bgcolor="#FF9966">11111111111</td>
    </tr>
    </table>
  • 相关阅读:
    ES6小点心第二弹——底部浮现弹窗
    ES6小点心之通用弹窗
    从输入URL到页面加载的过程?如何由一道题完善自己的前端知识体系!
    【quickhybrid】如何实现一个Hybrid框架
    【开源】canvas图像裁剪、压缩、旋转
    优雅的H5下拉刷新【minirefresh】
    前端筑基篇(一)->ajax跨域原理以及解决方案
    钉钉开放与商业化团队前端大量招人
    AJAX请求真的不安全么?谈谈Web安全与AJAX的关系。
    【quickhybrid】iOS端的项目实现
  • 原文地址:https://www.cnblogs.com/xianzuoqiaoqi/p/1566278.html
Copyright © 2011-2022 走看看