在我們製作首頁的過程中,用到表格的地方非常多,靈活運用表格技巧能為網頁增色不少。以下詳細介紹幾種特效表格的製作方法。
一、彩色虛線表格
<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>