html网页设计表格,如何通过css让表格只有外边框,而没有内边框?或者只有内边框,而没有外边框?

html网页设计表格,如何通过css让表格只有外边框,而没有内边框?或者只有内边框,而没有外边框?,第1张

table{\x0d\x0aborder:1px solid #000/*黑色1像素粗边框*/\x0d\x0a}\x0d\x0atd{\x0d\x0aborder:none/*这个是单元格,不给他要边框*/\x0d\x0a}\x0d\x0a以上是全局的,用了以后所有的表格都是这个样式。\x0d\x0a如果你要给特定的表格加入这个样式:\x0d\x0a1 给那个表格加上class='classname' (classname是你自己起的样式名)\x0d\x0a2 然后在CSS里加上\x0d\x0a.classname{\x0d\x0aborder:1px solid #000/*黑色1像素粗边框*/\x0d\x0a}\x0d\x0a.classname td{\x0d\x0aborder:none/*这个是单元格,不给他要边框*/\x0d\x0a}\x0d\x0a\x0d\x0a只有内边框没有外边框的话,我就只会用赖皮的方法:给table外面套一个overflow:hidden的div,宽度和高度比table小2px,给table加上margin-left:-1pxmargin-right:-1px这样把他的表格边框遮住。。

在html5页面中,要使表格的边框不显示,应设置border的值为()

1

0(正确答案)

2

3

<style type="text/css">

<!--

.aaa {

border-right-width: 1px

border-bottom-width: 1px

border-left-width: 1px

border-top-style: none

border-right-style: solid

border-bottom-style: solid

border-left-style: solid

border-right-color: #666666

border-bottom-color: #666666

border-left-color: #666666

text-align: center

}

-->

</style>

<table width="100" border="0" cellpadding="0" cellspacing="0">

<tr>

<td class="aaa">表格内容</td>

</tr>

</table>


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/7110419.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-01
下一篇 2023-04-01

发表评论

登录后才能评论

评论列表(0条)

保存