今天是:
设为首页 加入收藏 网站地图  
正在加截flash,如果长时间无显示,请下载FlashPlayer 9.0
您现在的位置: 呼网互联 >> 技术教程 >> 网站建设 >> CSS/HTML >> 教程正文 用户登录 新用户注册
[组图]简单实用的网页表格特效         ★★★
简单实用的网页表格特效
作者:黄明华 文章来源:天极设计在线 点击数: 更新时间:2005-12-19 12:55:08

  在我们制作主页的过程中,用到表格的地方非常多,灵活运用表格技巧可以为我们的网页增色不少,这里我就详细介绍几中特效表格的制作方法。

  一、彩色虚线表格


<style type="text/css">
<!--
.tab1 {
border-top-width: thin;
border-right-width: thin;
border-bottom-width: thin;
border-left-width: thin;
border-top-style: dotted;
border-right-style: dotted;
border-bottom-style: dotted;
border-left-style: dotted;
border-top-color: #00CC66;
border-right-color: #0099CC;
border-bottom-color: #FF0000;
border-left-color: #6699FF;
}
-->
</style>
<table width="200" border="0" cellpadding="2" cellspacing="2" class="tab1">
<tr>
<td><div align="center">虚</div></td>
<td><div align="center">线</div></td>
</tr>
<tr>
<td><div align="center">表</div></td>
<td><div align="center">格</div></td>
</tr>
</table>

  二、鼠标指向单元格变色
onmouseout="this.style.backgroundColor=''" 鼠标离开效果onmouseover="this.style.backgroundColor='#FFcccc'"鼠标放上去的效果,可以修改#FFcccc的值来改变颜色
<table width="200" border="1" cellspacing="0" cellpadding="0">
<tr>
<td onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#FFcccc'"> </td>
</tr>
<tr>
<td onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#FFccaa'"> </td>
</tr>
</table>

  三、立体表格


<table border="1" bordercolorlight="#ffffff" bordercolordark="#ffffff" width="200" cellpadding="0" cellspacing="0">
<tr align="center">
<td width="86"
bordercolorlight="#000000" bordercolordark="#eeeeee" bgcolor="#B7B7B7" >立体</td>
<td width="108"
bordercolorlight="#000000" bordercolordark="#eeeeee" bgcolor="#B7B7B7" >表格</td>
</tr>
</table>

  四、表格嵌套
  1、利用表格的间距来做嵌套
<table width="200" border="1" cellspacing="4" cellpadding="0">
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
  主要是用到间距 cellspacing="4"


  2、充分利用根据表格对齐的方式
  这里主要是将第一个表格居左,第二个表格居右,第三个表格居中。这样当你随意调整里面三个表格大小的时候,他们的间距将保持不变,非常方便。


<table width="200" border="1" cellpadding="0" cellspacing="0" bordercolor="#FF0000">
<tr>
<td><table width="60" border="1" align="left" cellpadding="0" cellspacing="0">
<tr>
<td> </td>
</tr>
</table>
<table width="60" border="1" align="right" cellpadding="0" cellspacing="0">
<tr>
<td> </td>
</tr>
</table>
<table width="80" border="1" align="center" cellpadding="0" cellspacing="0">
<tr>
<td> </td>
</tr>
</table></td>
</tr>
</table>

  五、半透明表格


  这里主要是用到了CSS滤镜filter: Alpha(Opacity=20)。
<style type="text/css">
<!--
.bg {
background-color: #66CCFF;
filter: Alpha(Opacity=20);
}
-->
<table width="200" border="0" cellpadding="0" cellspacing="0" class="bg">
<tr>
<td><div align="center">半</div></td>
<td><div align="center">透明</div></td>
</tr>
<tr>
<td><div align="center">表</div></td>
<td><div align="center">格</div></td>
</tr>
</table>

  六、阴影表格


  这里主要用到了CSS滤镜style="filter:shadow(color=#cccccc,direction=120);width:300;padding-right:10;padding-bottom:10"
<div style="filter:shadow(color=#cccccc,direction=120);width:300;padding-right:10;padding-bottom:10">
<table width=300 border=1 bgcolor=#EAEAEA>
<tr><td width="93">111</td><td width="91">222</td><td width="94">333</td></tr>
</table>
</div>

  附:插入CSS样式的方法(我们这里用半透明表格来做说明)
  第一种方法是定义一个CSS名称。
  比如
<style type="text/css">
<!--
.bg {
background-color: #66CCFF;
filter: Alpha(Opacity=20);
}
-->
  元素需要用到CSS的时候,比如表格,定义一个CLASS就可以了,如
<table width="200" border="0" cellpadding="0" cellspacing="0" class="bg">
  第二种是直接在你需要用到CSS元素的地方插入相关代码,style=""如:
<table width="201" border="1" style="filter: Alpha(Opacity=20);background-color: #66CCFF;">

教程录入:流云    责任编辑:流云 
  • 上一篇教程:

  • 下一篇教程:
  • 【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
    · Win XP设置技巧
    · 注册表全攻略
    · Dreamweaver 8
    · Fireworks 8
    · Flash 8
    · Photoshop CS2
    · Corel Draw
    普通教程[组图]十招学会使用Win
    普通教程[组图]Vista兼容性问题
    普通教程[组图]让低端显卡运行V
    推荐教程[图文]多图激赏:Window
    普通教程[组图]Windows Vista小
    推荐教程[图文]CSS实现星级效果
    普通教程[组图]你知道吗?有关V
    推荐教程[图文]廿五则Windows V
    推荐教程[图文]多图激赏:Window
    推荐教程[图文]CSS实现星级效果
    推荐教程[图文]廿五则Windows V
    推荐教程[图文]CorelDRAW经典教
    推荐教程[图文]蓝色人物绘制教程
    推荐教程[图文]韩式风格教程之油
    推荐教程[图文]AI进阶教程之月亮
    推荐教程XP中可以被禁用的服务对
    飞扬的韵律—用Photosh
    使用Photoshop CS2轻松
    水漫金山!教你用Photo
    神奇的变换!Photoshop
    Photoshop制作金灿灿的

    多图激赏:Windows V

    CSS实现星级效果总结

    廿五则Windows Vist

    可控声音 flash 教程
    (只显示最新10条。评论内容只代表网友观点,与本站立场无关!)