如何在表中删除边框间距 [英] how to delete border spacing in table

查看:140
本文介绍了如何在表中删除边框间距的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个表,第一行是

<tr>
<th>1</th>
<th>2</th>
</tr>

我给th投了一个黑色的背景。现在1和2单元格之间有一些种类的边界/分隔他们...我看了源代码,我想我发现了一些:

I putted a black background to "th". Now the 1 and 2 cells have some kind of border between/separating them... I had a look in source code and I think I found something:

border-collapse: separate;
border-spacing: 2px;

此css代码在源代码中列为用户代理样式表,我无法启用/禁用它来测试这是否是问题,但我尝试并添加了相同的代码,但none和0参数,但它没有帮助...

This css code is listed in source code as "user agent stylesheettable" and I couldn't enable/disable it to test if this is the problem, but I tried and added the same code but with "none" and "0" parameters but it didn't help neither...

有人可以帮助和帮我解开边界吗?

Can somebody help and quide me where is the border from please?

谢谢。

推荐答案

默认情况下,您的表格如下所示,并对表ID或类

Your table be like below by default and set the css rules on tables ID or Class

<table border="0" cellspacing="0" cellpadding="0">
 <tr>
  <th>1</th>
  <th>2</th>
</tr>
</table>

css:

border-collapse: collapse;

这篇关于如何在表中删除边框间距的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆