Html:单元格间距和单元格填充之间的差异

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15517632/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 06:41:35  来源:igfitidea点击:

Html: Difference between cell spacing and cell padding

htmlcsscellspacingcellpadding

提问by Explorer

What is the difference between cell spacing and cell padding?

单元格间距和单元格填充有什么区别?

回答by Nayana Adassuriya

This is the simple answer I can give.

这是我能给出的简单答案。

enter image description here

在此处输入图片说明

回答by Sahil Popli

cellspacing and cell padding

单元格间距和单元格填充



Cell padding

单元格填充

is used for formatting purpose which is used to specify the space needed between the edges of the cells and also in the cell contents. The general format of specifying cell padding is as follows:

用于格式化目的,用于指定单元格边缘之间以及单元格内容中所需的空间。指定单元格填充的一般格式如下:

< table width="100" border="2" cellpadding="5">

The above adds 5 pixels of padding inside each cell .

以上在每个单元格内添加了 5 个像素的填充。

Cell Spacing:

单元格间距:

Cell spacing is one also used f formatting but there is a major difference between cell padding and cell spacing. It is as follows: Cell padding is used to set extra space which is used to separate cell walls from their contents. But in contrast cell spacing is used to set space between cells.

单元格间距也是使用 f 格式的一种,但单元格填充和单元格间距之间存在重大差异。如下: 单元格填充用于设置额外的空间,用于将单元格壁与其内容分开。但相比之下,单元格间距用于设置单元格之间的空间。

回答by Rohit Azad

Cellpaddingis the amount of space between the outer edges of the table cell and the content of the cell.

Cellpadding是表格单元格外边缘与单元格内容之间的空间量。

Cellspacingis the amount of space in between the individual table cells.

Cellspacing是各个表格单元格之间的空间量。

More Details*Link 1*

更多详情*链接 1*

Link 2

链接 2

Link 3

链接 3

回答by Sanober Malik

CellSpacing as the name suggests it is the Space between the Adjacent cells and CellPadding on the other hand means the padding around the cell content.

顾名思义,CellSpacing 是相邻单元格之间的空间,而 CellPadding 则是指单元格内容周围的填充。

回答by Dai

Cell spacing and margin is the space betweencells.

单元格间距和边距是单元格之间的空间。

Cell padding is space inside cells, between the cell border (even if invisible) and the cell content, such as text.

单元格内边距是单元格内、单元格边框(即使不可见)和单元格内容(例如文本)之间的空间。