首页 > 工具 > Dreamweaver > 正文

简单实用的网页表格特效-Dreamweaver教程

2020-09-19 12:34:37
字体:
来源:转载
供稿:网友

一、彩色虚线表格

虚 线
表 格

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

六、阴影表格


111 222 333

  这里主要用到了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;">


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表