设置表格边框为1px的方法
下面是網頁制作中八種設置表格邊框為1px的方法:
第一種:
使用1*1的圖片,來填充單元格背景,并設置單元格的寬度,高度為1px
第二種:
<html>
<body>
<table width="200" height="100" border="1" bordercolor="red" cellspacing="0">
<tr>
<td></td><!--單元格中不要插入任何內容-->
</tr>
</table>
</body>
</html>
第三種:利用二級表格
<table width="200" height="100" border="0" bgcolor="red" cellspacing="0" cellpadding="0">
<tr>
<td align="center" valign="middle">
<table width="198" height="98" bgcolor="white" border="0">
<tr>
<td>www.blueidea.com</td>
</tr>
</table>
</td>
</tr>
</table>
第四種:利用單元格背景填充
<table width="200" height="100" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="3" height="1" bgcolor="red"></td>
</tr>
<tr>
<td width="1" bgcolor="green"></td><td width="198" height="98">www.blueidea.com</td><td width="1" bgcolor="blue"></td>
</tr>
<tr>
<td colspan="3" height="1" bgcolor="orchid"></td>
</tr>
</table>
第五種:利用亮邊框和暗邊框
<table width="200" height="100" border="1" bordercolorlight="red" bordercolordark="white"
cellpadding="0" cellspacing="0">
<tr>
<td>www.blueidea.com</td><td>www.blueidea.com</td>
</tr>
</table>
第六種:利用單元格的間距
<table width="200" height="100" border="0" bgcolor="red"
cellpadding="0" cellspacing="1">
<tr>
<td bgcolor="white">www.blueidea.com</td><td? bgcolor="white">www.blueidea.com</td>
</tr>
</table>
第七種:利用collapse
<table width="200" height="100" border="1" bordercolor="blue" cellspacing="0" style="border-collapse:collapse">
<tr>
<td>www.blueidea.com</td><td>www.blueidea.com</td>
</tr>
</table>
第八種:利用border:
<table width="200" height="100" border="0" style="border:1px red solid">
<tr>
<td>www.blueidea.com</td>
</tr>
</table>
轉載于:https://www.cnblogs.com/ghostbox/archive/2010/05/19/1738938.html
總結
以上是生活随笔為你收集整理的设置表格边框为1px的方法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 前端随笔整理[5.14]
- 下一篇: 2009年下半年信息系统项目管理师上午试