为什么单元格和cellpadding不是CSS样式 [英] Why are cellspacing and cellpadding not CSS styles
本文介绍了为什么单元格和cellpadding不是CSS样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我不知道为什么这让我很烦恼,但当我创建网站,我总是试图做所有我的样式与CSS。但是,当我使用表格时,总是要记住一件事情,那就是添加cellspacing =0和cellpadding =0。
I don't know why this bothers me so much, but when I create websites, I always try to do all my styling with CSS. However one thing I always have to remember to do when I'm working with tables is add cellspacing="0" and cellpadding="0"
CSS属性覆盖这些过期的HTML 4属性?
Why is there not a CSS property to override these antiquated HTML 4 attributes?
推荐答案
table { border-collapse: collapse; }
至于 cellpadding ,你可以做
table tr td, table tr th { padding: 0; }
这篇关于为什么单元格和cellpadding不是CSS样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文