html中表格的问题

来源:百度知道 编辑:UC知道 时间:2024/05/22 01:10:36
我要做一个只有外框,单元格之间的边框为0的表格.怎么做?

容易.你所说的是俗称"单线表格"的表格。
比如Baidu这个表格,只有一条绿色的边线。
在frontpage中,叫“边框折叠”
在代码中,需要用到一句 CSS,如下:

<table width=300 height=300 border=1 cellspacing=0 cellspadding=0 bordercolor=red style="border-collapse:collapse">
</tr><td></td></tr>
</table>

本代码复制之后,存成网页,运行之后即可得到一个红色边框的表格。

如果只要一个外面框的话还要在这里面加一个表格
<table width=300 height=300 border=1 cellspacing=0 cellspadding=0 bordercolor=red style="border-collapse:collapse">
</tr><td>
<table width=300 height=300 border=0 cellspacing=0 cellspadding=0 >
</tr><td>1</td></tr>
</tr><td>2</td></tr>
</table>
</td></tr>
</table>
这样就可以了

<style type="text/css">
<!--
table.abc tr{border:0px;}
table.abc td{border:0px;}
-->
</style>
<table clas