网络编程 | 站长之家 | 网页制作 | 图形图象 | 操作系统 | 冲浪宝典 | 软件教学 | 网络办公 | 邮件系统 | 网络安全 | 认证考试 | 系统进程
Firefox | IE | Maxthon | 迅雷 | 电驴 | BitComet | FlashGet | QQ | QQ空间 | Vista | 输入法 | Ghost | Word | Excel | wps | Powerpoint
asp | .net | php | jsp | Sql | c# | Ajax | xml | Dreamweaver | FrontPages | Javascript | css | photoshop | fireworks | Flash | Cad | Discuz!
当前位置 > 网站建设学院 > 网页制作 > HTML
网页制作:Dreamweaver教程,FrontPages教程,Javascript教程,HTML教程,CSS教程,心得技巧,DHTML教程,网页特效,Discuz!论坛
本月文章推荐
.制作虚线效果的水平线.
.实现网页的动态过渡效果.
.中文网页制作中段落缩进的方法.
.HTML文件中也玩include文件包含.
.HTML 基本语法.
.初学web标准的几个误区.
.页面上所有的链接都在新窗口打开.
.基于Web标准的UI组件 — 菜单(1).
.HTML用INS和DEL标记文档改变.
.XHTML 1.0.
.HTML:WEB标准从头开始.
.网页设计:一种细腻的导航效果的制.
.使用Web标准建站第12天:校验及常.
.HTML组件(HTML COMPONENTS)之七.
.WEB标准学习:自定义打开链接的方.
.改变浏览者的鼠标型状.
.HTML之链接标记.
.HTML语言:总结性笔记,谢谢支持.
.HTML之图形标记.
.HTML之字体标记.

简单实用的网页表格特效

发表日期:2005-7-7


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

  一、彩色虚线表格

<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;">
上一篇:解析HTML的增强标记 人气:9173
下一篇:几个对图形进行动态处理的dhtml代码 人气:8524
浏览全部HTML的内容 Dreamweaver插件下载 网页广告代码 祝你圣诞节快乐 2009年新年快乐