1,table 中的cellpadding与cellspacing的含义:
cellpadding:规定单元边沿与其内容之间的空白
cellpadding:规定的是单元之间的空间
![常用的CSS[持续更新]](https://javaforall.net/wp-content/uploads/2020/11/2020110817443450.jpg)
![常用的CSS[持续更新]](https://javaforall.net/wp-content/uploads/2020/11/2020110817443450.jpg)
View Code
<table border="1" cellpadding="20" cellspacing="10"> <tbody> <tr> <td>aaa</td><td>bbbb</td><td>ccc</td><td>dddd</td> </tr> <tr> <td>aaa</td><td>bbbb</td><td>ccc</td><td>dddd</td> </tr> <tr> <td>aaa</td><td>bbbb</td><td>ccc</td><td>dddd</td> </tr> </tbody> </table>
2,水平居中 margin:0 auto;
<div style="width:600px;background-color:Aqua;"> <div style="width:200px; height:200px; background-color:Teal;margin:0 auto;"></div> </div>
效果:
转载于:https://www.cnblogs.com/dataadapter/archive/2012/12/11/2812389.html
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/110264.html原文链接:https://javaforall.net