Table.CellSpacing 属性


获取或设置单元格间的空间量。Gets or sets the amount of space between cells.

 virtual property int CellSpacing { int get(); void set(int value); };
public virtual int CellSpacing { get; set; }
public virtual int CellSpacing { get; set; }
member this.CellSpacing : int with get, set
Public Overridable Property CellSpacing As Integer


单元格之间的空间量(以像素为单位)。The amount of space, in pixels, between cells. 默认值为 -1,表示还未设置该属性。The default value is -1, which indicates that the property has not been set.



使用 CellSpacing 属性可控制 Table 控件中相邻单元格之间的间距。Use the CellSpacing property to control the spacing between adjacent cells in the Table control. 此间距同时应用于垂直和水平。This spacing is applied both vertically and horizontally. 单元格间距对于整个表是统一的。The cell spacing is uniform for the entire table. 不能指定每个行或列之间的单个单元间距。Individual cell spacing between each row or column cannot be specified.


如果将此属性设置为大于0的值并将 GridLines 属性设置为显示单元格边框的值,则相邻单元格的边框之间将显示一个间隙。If you set this property to a value greater than 0 and set the GridLines property to a value that displays the cell borders, a gap is displayed between the borders of adjacent cells. 在这种情况下,CellSpacing 属性控制间隙的大小。In this situation, the CellSpacing property controls the size of the gap.