- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
是
border-collapse:collapse;
和
border-spacing: 0px; /* only active/useful with option "separate" */
border-collapse:separate;
一样吗?
最佳答案
它们是不同的!(请参阅下面的代码段以确认)。
The
border-collapse
CSS property determines whether a table's borders are separated or collapsed. In the separated model, adjacent cells each have their own distinct borders. In the collapsed model, adjacent table cells share borders.
和
The
border-spacing
CSS property specifies the distance between the borders of adjacent table cells (only for the separated borders model). This is equivalent to thecellspacing
attribute in presentational HTML, but an optional second value can be used to set different horizontal and vertical spacing.The
border-spacing
value is also used along the outside edge of the table, where the distance between the table's border and the cells in the first/last column or row is the sum of the relevant (horizontal or vertical)border-spacing
and the relevant (top, right, bottom, or left) padding on the table.This property applies only when
border-collapse
isseparate
.
body {
margin: 0;
font-family: Arial;
}
table {
width: 100%;
margin:30px 0
}
td {
border: 1px solid red
}
.collapse {
border-collapse: collapse;
}
.separate {
border-collapse: separate;
}
.no-spacing {
border-spacing: 0
}
.spacing {
border-spacing: 10px
}
<h4>Borders will collapse and therefore no space between them</h4>
<table class="collapse no-spacing">
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<h4>Borders will try to separate between them but then using border-spacing:0 will join the borders without collpasing (looking like has double borders)</h4>
<table class="separate no-spacing">
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<hr />
<h3> 2 more examples </h3>
<h4>Border-spacing won't work due to only applies when border-collapse isset to separate</h4>
<table class="collapse spacing">
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<hr />
<h4>Borders will separate between them due to having border-spacing:10px and because border-collapse has separate as initial value</h4>
<table class="spacing">
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
关于html - border-collapse : collapse; and border-spacing: 0;有什么区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36035461/
我系统上的docker info命令输出如下: # docker info Containers: 0 Images: 0 Storage Driver: devicemapper ..... D
我如何捕获用户按下 ctrl + space + space? 我用这段代码成功测试了ctrl + space: RegisterHotKey(0, 1, MOD_CONTROL, VK_SPACE)
我有一个 Matlab 图,我想在论文中使用。此图包含多个 cdfplots。现在的问题是我不能使用标记,因为在情节中变得非常密集。如果我想让样本稀疏,我必须从 cdfplot 中删除一些样本,这将导
我正在尝试获取我将用于备份的服务器上所有数据库的列表。以下是我尝试打印数据库列表但出现错误的代码片段。如何解决?添加双方括号并不能解决问题。 我已经研究了一些类似的问题,但我无法弄清楚。 grep:字
我了解 new gen/old gen/perm gen 之间的区别,但我不知道“To Space”和“From Space”是什么。我看到我的“From Space”使用率达到 99.8%,而“To
我当前有一个返回时看起来像这样的字符串: //This is the url string // the-great-debate---toilet-paper-over-or-under-the-r
我太亲密了。我正在尝试编写用于Notepad++的正则表达式表达式,以用空格替换破折号,而忽略已经用前置/后置空格代替的破折号。我知道我可以用“foobarfoo”搜索/替换“-”,然后搜索“-”替换
我的 ANTLR 代码如下: LPARENTHESIS : ('('); RPARENTHESIS : (')'); fragment CHARACTER : ('a'..'z'|'0'..'9'|)
在过去的 6 个小时里,我一直在尝试在我的 webgl 应用程序中实现点击,但我找不到任何关于这个主题的足够清晰的内容。 到目前为止,我想出的是伪代码: screenSpace = mousePosi
如何使用正则表达式来测试空格或制表符,但不测试换行符? 我尝试了 \s,但我发现它也测试换行符。 我使用C# (.NET) 和 WPF ,但这应该不重要。 最佳答案 使用字符类:[\t] 关于rege
我想解析以下内容: name:name 名称以字母开头和结尾,并且可以包含字母和空格的任意组合。它们也可以是空白的。我的规则是: identifier = alnum (space* alnum)*;
有什么办法可以让 Eden 空间按比例大于 Tenured 空间吗?有 NewRatio 但它以相反的方式工作(Tenured 比 Eden 大几倍)。 我知道有 -XX:NewSize= 和 -XX
我正在编写一个程序,让人们输入他们的信息(姓名,年龄......)。对于姓名输入,我不希望他们留空,只允许字母和空格,但不能以空格开头。合适的正则表达式是什么?我尝试使用: ^[a-zA-Z\\s]*
好的,我正在制作一个程序,它也可以制作垂直线、水平线和对角线!我对我的一个没有任何意义的输出感到困惑。 所以我的伪代码是这样的: //enter a char //enter a number
当我使用 scp 从服务器复制文件时, 我错误地使用了命令 scp xxx@xxxx:xx.zip . 当我完成后,我发现该文件的名称是 .我无法解压 这是目录列表。 http://pfil
我需要一个 bat 文件来获取 Windows 系统中 C:\驱动器的总空间和可用空间(以 GB(千兆字节)为单位),并创建一个包含详细信息的文本文件。 注意:我不想使用任何外部实用程序。 最佳答案
作为预处理我的数据的一部分。我希望能够替换空格后跟数字,同时保留空格后跟一个字符。例如: Input String: '8.1.7 Sep 2000 Dec 2004 Dec 2006 Indefin
我正在编写一个 XPath 表达式,但我修复了一个奇怪的错误,但是以下两个 XPath 表达式之间有什么区别? "//td[starts-with(normalize-space()),'Posted
在 C 中,当读取文本文件时,是否有可能接受一个未知大小的整数值(假设它适合 int),因为它在数字之前和数字之后都有一个空格。例如。 363 865我想分别存储 363 和 865,因为它们有自己的
在 sys/ptrace.h 中,我看到类似这样的内容: @define PT_READ_I 1 /* read world in child's I space*/ @define PT_READ
我是一名优秀的程序员,十分优秀!