- <table class="t FCK__ShowTableBorders" cellspacing="0" cellpadding="8" width="600" border="0">
- <tbody>
- <tr>
- <td width="220">
- <table cellspacing="0" cellpadding="0" rules="cols" width="200" border="1">
- <tbody>
- <tr align="center">
- <td>第</td>
- <td>一</td>
- <td>行</td>
- </tr>
- <tr align="center">
- <td>第</td>
- <td>二</td>
- <td>行</td>
- </tr>
- <tr align="center">
- <td>第</td>
- <td>三</td>
- <td>行</td>
- </tr>
- </tbody>
- </table>
- </td>
- <td width="380">这个表格去掉了单元格之间的纵向分隔线</td>
- </tr>
- <tr>
- <td><br>
- <table cellspacing="0" cellpadding="0" rules="rows" width="200" border="1">
- <tbody>
- <tr align="center">
- <td>第</td>
- <td>第</td>
- <td>第</td>
- </tr>
- <tr align="center">
- <td>一</td>
- <td>二</td>
- <td>三</td>
- </tr>
- <tr align="center">
- <td>列</td>
- <td>列</td>
- <td>列</td>
- </tr>
- </tbody>
- </table>
- </td>
- <td>这个表格去掉了单元格之间的横向分隔线</td>
- </tr>
- <tr>
- <td>
- <table cellspacing="0" cellpadding="0" rules="none" width="200" border="1">
- <tbody>
- <tr align="center">
- <td>横</td>
- <td> </td>
- <td>线</td>
- </tr>
- <tr align="center">
- <td>竖</td>
- <td> </td>
- <td>线</td>
- </tr>
- <tr align="center">
- <td>都</td>
- <td>没</td>
- <td>了</td>
- </tr>
- </tbody>
- </table>
- </td>
- <td>这个表格去掉了单元格之间的纵向分隔线和横向分隔线</td>
- </tr>
- <tr>
- <td colspan="2"><hr color="#000000" size="1">
- 其实上面的三个表格都有三行三列,隐藏分隔线的诀窍在于rules,察看这三个表格的源代码,我们可以看到<TABLE>标签中都有rules。 它有三个参数(cols,rows,none),当rules=cols时,表格会隐藏纵向的分隔线,这样我们就只能看到表格的行;当rules=rows时,则 隐藏了横向的分隔线,这样我们只能看到表格的列;而当rules=none时,纵向分隔线和横向分隔线将全部隐藏。</td>
- </tr>
- </tbody>
- </table>
- <br>
- <br>
- <br>
- <table class="FCK__ShowTableBorders" height="30" cellspacing="0" cellpadding="0" width="600" border="0">
- <tbody>
- <tr>
- <td><strong>二、表格边框的隐藏</strong></td>
- </tr>
- </tbody>
- </table>
- <table class="t FCK__ShowTableBorders" cellspacing="0" cellpadding="8" width="600" border="0">
- <tbody>
- <tr>
- <td>
- <table cellspacing="0" cellpadding="0" width="200" border="1">
- <tbody>
- <tr align="center">
- <td>普</td>
- <td>表</td>
- </tr>
- <tr align="center">
- <td>通</td>
- <td>格</td>
- </tr>
- </tbody>
- </table>
- </td>
- <td>这是一普通的表格</td>
- </tr>
- <tr>
- <td><br>
- <table cellspacing="0" cellpadding="0" width="200" border="1" frame="above">
- <tbody>
- <tr align="center">
- <td>不怕</td>
- <td>下雨</td>
- </tr>
- <tr align="center">
- <td> </td>
- <td> </td>
- </tr>
- </tbody>
- </table>
- </td>
- <td>只显示上边框</td>
- </tr>
- <tr>
- <td>
- <table cellspacing="0" cellpadding="0" width="200" border="1" frame="below">
- <tbody>
- <tr>
- <td> </td>
- <td> </td>
- </tr>
- <tr>
- <td align="center">下起雨来</td>
- <td align="center">该怎么办</td>
- </tr>
- </tbody>
- </table>
- </td>
- <td>只显示下边框</td>
- </tr>
- <tr>
- <td><br>
- <table cellspacing="0" cellpadding="0" width="200" border="1" frame="vsides">
- <tbody>
- <tr>
- <td align="center">上不着天</td>
- <td> </td>
- </tr>
- <tr>
- <td> </td>
- <td align="center">下不着地</td>
- </tr>
- </tbody>
- </table>
- </td>
- <td>只显示左、右边框</td>
- </tr>
- <tr>
- <td>
- <table cellspacing="0" cellpadding="0" width="200" border="1" frame="hsides">
- <tbody>
- <tr>
- <td> </td>
- <td align="center">两边走开</td>
- </tr>
- <tr>
- <td align="center">老子姓王</td>
- <td> </td>
- </tr>
- </tbody>
- </table>
- </td>
- <td>只显示上、下边框</td>
- </tr>
- <tr>
- <td><br>
- <table cellspacing="0" cellpadding="0" width="200" border="1" frame="lhs">
- <tbody>
- <tr>
- <td width="100">左右</td>
- <td width="100"> </td>
- </tr>
- <tr>
- <td>为难</td>
- <td> </td>
- </tr>
- </tbody>
- </table>
- </td>
- <td>只显示左边框</td>
- </tr>
- <tr>
- <td>
- <table cellspacing="0" cellpadding="0" width="200" border="1" frame="rhs">
- <tbody>
- <tr>
- <td width="100"> </td>
- <td align="right" width="100">左右</td>
- </tr>
- <tr>
- <td> </td>
- <td align="right">为难</td>
- </tr>
- </tbody>
- </table>
- </td>
- <td>只显示右边框</td>
- </tr>
- <tr>
- <td><br>
- <table cellspacing="0" cellpadding="0" width="200" border="1" frame="void">
- <tbody>
- <tr>
- <td align="right">光秃秃</td>
- <td> </td>
- </tr>
- <tr>
- <td> </td>
- <td align="left">全脱了</td>
- </tr>
- </tbody>
- </table>
- </td>
- <td>不显示任何边框</td>
- </tr>
- <tr>
- <td colspan="2"><hr color="#000000" size="1">
- 表格边框的显示与隐藏,是可以用frame参数来控制的。请注意它只控制表格的边框图,而不影晌单元格。<br>
- 只显示上边框 <table frame=above><br>
- 只显示下边框 <table frame=below> <br>
- 只显示左、右边框 <table frame=vsides><br>
- 只显示上、下边框 <table frame=hsides><br>
- 只显示左边框 <table frame=lhs><br>
- 只显示右边框 <table frame=rhs><br>
- 不显示任何边框 <table frame=void></td>
- </tr>
- </tbody>
- </table>
- <p> </p>
- <p>
- <table class="FCK__ShowTableBorders" height="30" cellspacing="0" cellpadding="0" width="600" border="0">
- <tbody>
- <tr>
- <td><strong>三、表格边框</strong></td>
- </tr>
- </tbody>
- </table>
- <table class="t FCK__ShowTableBorders" cellspacing="0" cellpadding="8" width="600" border="0">
- <tbody>
- <tr valign="top">
- <td>
- <table cellspacing="0" cellpadding="0" width="200" border="1">
- <tbody>
- <tr align="center">
- <td>普</td>
- <td>表</td>
- </tr>
- <tr align="center">
- <td>通</td>
- <td>格</td>
- </tr>
- </tbody>
- </table>
- 这是一普通的表格</td>
- <td><table border="1" width="200" cellpadding="0" cellspacing="0"> <tr align="center"> <td>普</td> <td>表</td> </tr> <tr align="center"> <td>通</td> <td>格</td> </tr> </table> </td>
- </tr>
- <tr valign="top">
- <td>
- <table class="FCK__ShowTableBorders" cellspacing="1" cellpadding="0" width="200" bgcolor="#000000" border="0">
- <tbody>
- <tr align="center" bgcolor="#ffffff">
- <td bgcolor="#ffffff">细</td>
- <td bgcolor="#ffffff">表</td>
- </tr>
- <tr align="center" bgcolor="#ffffff">
- <td bgcolor="#ffffff">线</td>
- <td bgcolor="#ffffff">格</td>
- </tr>
- </tbody>
- </table>
- 表格加上了漂亮的细线<br>
- (利用cellspacing1像素间隙和表格与单元格背景的不同)</td>
- <td><table border="0" width="200" cellspacing="1" cellpadding="0" bgcolor="#000000" > <tr align="center" bgcolor="#FFFFFF"> <td bgcolor="#FFFFFF">细</td> <td bgcolor="#FFFFFF">表</td> </tr> <tr align="center" bgcolor="#FFFFFF"> <td bgcolor="#FFFFFF">线</td> <td bgcolor="#FFFFFF">格</td> </tr> </table> </td>
- </tr>
- <tr valign="top">
- <td>
- <table class="FCK__ShowTableBorders" cellspacing="0" cellpadding="0" width="200">
- <tbody>
- <tr align="center">
- <td style="border-right: rgb(0,0,0) 1px groove; border-top: rgb(0,0,0) 1px groove; border-left: rgb(0,0,0) 1px groove; border-bottom: rgb(0,0,0) 1px groove">细</td>
- <td style="border-right: rgb(0,0,0) 1px groove; border-top: rgb(0,0,0) 1px groove; border-bottom: rgb(0,0,0) 1px groove">表</td>
- </tr>
- <tr align="center">
- <td style="border-right: rgb(0,0,0) 1px groove; border-left: rgb(0,0,0) 1px groove; border-bottom: rgb(0,0,0) 1px groove">线</td>
- <td style="border-right: rgb(0,0,0) 1px groove; border-bottom: rgb(0,0,0) 1px groove">格</td>
- </tr>
- </tbody>
- </table>
- 这和上面那个可不一样,它用的是CSS,效果却一样。<br>
- (对单元格border的定义)</td>
- <td><table width="200" cellspacing="0" cellpadding="0"> <tr align="center"> <td style="BORDER-top: rgb(0,0,0) 1px groove; BORDER-bottom: rgb(0,0,0) 1px groove; BORDER-left: rgb(0,0,0) 1px groove; BORDER-right: rgb(0,0,0) 1px groove">细</td> <td style="BORDER-top: rgb(0,0,0) 1px groove; BORDER-bottom: rgb(0,0,0) 1px groove; BORDER-right: rgb(0,0,0) 1px groove">表</td> </tr> <tr align="center"> <td style="BORDER-bottom: rgb(0,0,0) 1px groove; BORDER-left: rgb(0,0,0) 1px groove; BORDER-right: rgb(0,0,0) 1px groove">线</td> <td style="BORDER-bottom: rgb(0,0,0) 1px groove; BORDER-right: rgb(0,0,0) 1px groove">格</td> </tr> </table> </td>
- </tr>
- <tr valign="top">
- <td>
- <table class="FCK__ShowTableBorders" cellspacing="0" cellpadding="0" width="200">
- <tbody>
- <tr align="center">
- <td style="border-right: rgb(0,0,0) 1px dotted; border-top: rgb(0,0,0) 1px dotted; border-left: rgb(0,0,0) 1px dotted; border-bottom: rgb(0,0,0) 1px dotted">细</td>
- <td style="border-right: rgb(0,0,0) 1px dotted; border-top: rgb(0,0,0) 1px dotted; border-bottom: rgb(0,0,0) 1px dotted">表</td>
- </tr>
- <tr align="center">
- <td style="border-right: rgb(0,0,0) 1px dotted; border-left: rgb(0,0,0) 1px dotted; border-bottom: rgb(0,0,0) 1px dotted">线</td>
- <td style="border-right: rgb(0,0,0) 1px dotted; border-bottom: rgb(0,0,0) 1px dotted">格</td>
- </tr>
- </tbody>
- </table>
- 再进一步,把边框变成虚线,同样是CSS的神奇作用。</td>
- <td><table width="200" cellspacing="0" cellpadding="0"> <tr align="center"> <td style="BORDER-top: rgb(0,0,0) 1px dotted; BORDER-bottom: rgb(0,0,0) 1px dotted; BORDER-left: rgb(0,0,0) 1px dotted; BORDER-right: rgb(0,0,0) 1px dotted">细</td> <td style="BORDER-top: rgb(0,0,0) 1px dotted; BORDER-bottom: rgb(0,0,0) 1px dotted; BORDER-right: rgb(0,0,0) 1px dotted">表</td> </tr> <td style="BORDER-bottom: rgb(0,0,0) 1px dotted; BORDER-left: rgb(0,0,0) 1px dotted; BORDER-right: rgb(0,0,0) 1px dotted">线</td> <td style="BORDER-bottom: rgb(0,0,0) 1px dotted; BORDER-right: rgb(0,0,0) 1px dotted">格</td> </tr> </table> </td>
- </tr>
- <tr valign="top">
- <td>
- <table class="FCK__ShowTableBorders" cellspacing="2" cellpadding="0" width="200" border="0">
- <tbody>
- <tr>
- <td>
- <table class="FCK__ShowTableBorders" cellspacing="1" cellpadding="0" width="100%" bgcolor="#000000" border="0">
- <tbody>
- <tr>
- <td bgcolor="#ffffff"> </td>
- </tr>
- </tbody>
- </table>
- </td>
- <td>
- <table class="FCK__ShowTableBorders" cellspacing="1" cellpadding="0" width="100%" bgcolor="#000000" border="0">
- <tbody>
- <tr>
- <td bgcolor="#ffffff"> </td>
- </tr>
- </tbody>
- </table>
- </td>
- </tr>
- <tr>
- <td>
- <table class="FCK__ShowTableBorders" cellspacing="1" cellpadding="0" width="100%" bgcolor="#000000" border="0">
- <tbody>
- <tr>
- <td bgcolor="#ffffff"> </td>
- </tr>
- </tbody>
- </table>
- </td>
- <td>
- <table class="FCK__ShowTableBorders" cellspacing="1" cellpadding="0" width="100%" bgcolor="#000000" border="0">
- <tbody>
- <tr>
- <td bgcolor="#ffffff"> </td>
- </tr>
- </tbody>
- </table>
- </td>
- </tr>
- </tbody>
- </table>
- 细线表格的扩展应用,奥妙就是在第个单元格中再套入一个表格。</td>
- <td><table width="200" border="0" cellspacing="2" cellpadding="0"> <tr> <td> <table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="#000000"> <tr> <td bgcolor="#FFFFFF"> </td> </tr> </table> </td> <td> <table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="#000000"> <tr> <td bgcolor="#FFFFFF"> </td> </tr> </table> </td> </tr> <tr> <td> <table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="#000000"> <tr> <td bgcolor="#FFFFFF"> </td> </tr> </table> </td> <td> <table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="#000000"> <tr> <td bgcolor="#FFFFFF"> </td> </tr> </table> </td> </tr> </table> </td>
- </tr>
- <tr valign="top">
- <td>
- <table cellspacing="0" bordercolordark="#ffffff" cellpadding="0" width="200" bordercolorlight="#ffffff" border="1">
- <tbody>
- <tr align="center">
- <td bordercolorlight="#000000" bgcolor="#b7b7b7" bordercolordark="#eeeeee">立</td>
- <td bordercolorlight="#000000" bgcolor="#b7b7b7" bordercolordark="#eeeeee">表</td>
- </tr>
- <tr align="center">
- <td bordercolorlight="#000000" bgcolor="#b7b7b7" bordercolordark="#eeeeee">体</td>
- <td bordercolorlight="#000000" bgcolor="#b7b7b7" bordercolordark="#eeeeee">格</td>
- </tr>
- </tbody>
- </table>
- 立体感的表格<br>
- (简单的亮暗边框设置,注意只有IE支持这种效果)</td>
- <td><table border="1" bordercolorlight="#ffffff" bordercolordark="#ffffff" width="200" cellpadding="0" cellspacing="0"> <tr align="center"> <td bgcolor="#B7B7B7" bordercolorlight="#000000" bordercolordark="#eeeeee" >立</td> <td bgcolor="#B7B7B7" bordercolorlight="#000000" bordercolordark="#eeeeee" >表</td> </tr> <tr align="center"> <td bgcolor="#B7B7B7" bordercolorlight="#000000" bordercolordark="#eeeeee" >体</td> <td bgcolor="#B7B7B7" bordercolorlight="#000000" bordercolordark="#eeeeee" >格</td> </tr> </table> </td>
- </tr>
- <tr valign="top">
- <td>
- <table class="FCK__ShowTableBorders" cellspacing="0" cellpadding="0" width="200">
- <tbody>
- <tr>
- <td><fieldset style="width: 200px" align="center"><legend>无名表格 </legend>
- <p align="right"> </p>
- </fieldset></td>
- </tr>
- </tbody>
- </table>
- 给表格加上一个表头<br>
- (应用<fieldset>和</legend>标签)</td>
- <td><table width="200" cellpadding="0" cellspacing="0"> <tr> <td><fieldset style="width:200" align="center"> <legend> 无名表格 </legend> <p align="right"> </fieldset></td> </tr> </table> </td>
- </tr>
- <tr valign="top">
- <td>
- <table class="FCK__ShowTableBorders" cellspacing="0" cellpadding="0" width="200">
- <tbody>
- <tr>
- <td><fieldset style="width: 200px; color: #b7b7b7; border-top-style: groove; border-right-style: groove; border-left-style: groove; border-bottom-style: groove" align="center"><legend style="border-right: #000000 1px solid; border-top: #000000 1px solid; border-left: #000000 1px solid; color: blue; border-bottom: #000000 1px solid">表中表效果Ⅰ</legend><br>
- </fieldset></td>
- </tr>
- </tbody>
- </table>
- 给表头再加个框<br>
- (用CSS为<legnd>定义一个边框)</td>
- <td><table width="200"" cellspacing="0" cellpadding="0"> <tr> <td> <fieldset style="width: 200; color: #B7B7B7; border-style: groove" align="center"> <legend style="color: blue; border: 1 solid #000000"> 表中表效果Ⅰ</legend> <br> </fieldset> </td> </tr> </table> </td>
- </tr>
- <tr valign="top">
- <td>
- <table class="FCK__ShowTableBorders" width="200">
- <tbody>
- <tr>
- <td><fieldset style="width: 200px" align="center"><legend>
- <table class="FCK__ShowTableBorders" style="border-right: #000000 1px solid; border-top: #000000 1px solid; border-left: #000000 1px solid; border-bottom: #000000 1px solid" height="20" cellspacing="1" cellpadding="0" width="80">
- <tbody>
- <tr>
- <td><font color="#0000ff">表中表效果Ⅱ</font></td>
- </tr>
- </tbody>
- </table>
- </legend><br>
- </fieldset></td>
- </tr>
- </tbody>
- </table>
- 看起来和上面的一样,可是这个才是真正的表中表哦。<br>
- (在<legnd>中插入一个表格)</td>
- <td><table width="200"> <tr> <td><fieldset style="width:200" align="center"> <legend> <table style="border: 1 solid #000000" width="80" cellspacing="1" cellpadding="0" height="20"> <tr> <td><font color=blue>表中表效果Ⅱ</font></td> </tr> </table> </legend><br> </fieldset> </td> </tr> </table> </td>
- </tr>
- <tr>
- <td colspan="2"><hr color="#000000" size="1">
- 这一节要靠你自己去发现了,因为这样学到的东西才是真正属于自己的(我的一个偷懒的借口)。 我已经在每个表格的下面写出了重点,并在右边给出它的源代码,你可以对照着看。下面还有一 个边框会自己变颜色闪动的表格,有兴趣也研究研究吧 ^o^</td>
- </tr>
- <tr>
- <td colspan="2">
- <p> </p>
- <hr color="#000000" size="1">
- <strong>下面来讲讲如何来快速的实现细线表格拉</strong>
- <p> </p>
- <p>。。其实很简单啊。。只要在标题那边嵌入一段小小的CSS就可以实现啦。虽然只能实现细线表格。。但是一目了然。嘻嘻</p>
- </td>
- </tr>
- <tr>
- <td><style type="text/css"><br>
- .table1{background:#000000;}<br>
- /* 这边定义了表格的背景,也就是边框的颜色 */<br>
- .table1 td, .table1 th{background:#FFFFFF} <br>
- /* 这边定义了表格内的单元格背景是白色啦,就细线就这样出现啦 */<br>
- </style><br>
- 这边你也可以定义背景为图片啦。不一样的图片会产生不一样的边框样式哦</td>
- <td>
- <p><table cellpadding="3" cellspacing="1" border="0" width="200" height="50" class="table1"><br>
- <tr><br>
- <td></td><br>
- <td></td><br>
- </tr><br>
- <tr><br>
- <td></td><br>
- <td></td><br>
- </tr><br>
- </table></p>
- <p>这边的表格结构是不是很清楚啦。。其中关键的是要设置cellspacing为"1"还有就是定义它的class为"table1"。。关键的俩个千万不能忘了哦,不然效果出不来的哦。。</p>
- </td>
- </tr>
- </tbody>
- </table>
table的边框线设置
最新推荐文章于 2024-08-07 02:17:51 发布