如何删除表格中的边框间距 [英] How to delete border spacing in table

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

问题描述

我有一张桌子,第一行就像

I have a table, first row is like

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

我为th"添加了黑色背景.现在 1 和 2 单元格之间有某种边界/分隔它们......我查看了源代码,我想我发现了一些东西:

I put 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 代码在源代码中列为用户代理样式表",我无法启用/禁用它来测试这是否是问题,但我尝试添加了相同的代码,但使用无"和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 guide me where is the border from please?

推荐答案

你的表格默认如下所示,并在表格 ID 或 Class 上设置 css 规则

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天全站免登陆