語言

Table.CellSpacing 屬性

定義

取得或設定表格中格子間距的長度。

public:
 property double CellSpacing { double get(); void set(double value); };
[System.ComponentModel.TypeConverter(typeof(System.Windows.LengthConverter))]
public double CellSpacing { get; set; }
[<System.ComponentModel.TypeConverter(typeof(System.Windows.LengthConverter))>]
member this.CellSpacing : double with get, set
Public Property CellSpacing As Double

屬性值

表格中單元間距的距離,以裝置獨立的像素為單位。

預設值是 2.0。

屬性

範例

以下範例定義了一個簡單的 2 x 3 表格,其 a CellSpacing 為 0.35 公分。

<Table Background="Yellow" CellSpacing="0.35cm">
  <Table.Columns>
    <TableColumn /> <TableColumn /> <TableColumn />
  </Table.Columns>
  <TableRowGroup>
    <TableRow>
      <TableCell Background="Cyan">
        <Paragraph>Cell at Row 1 Column 1</Paragraph>
      </TableCell>
      <TableCell Background="Cyan">
        <Paragraph>Cell at Row 1 Column 2</Paragraph>
        <Paragraph>Cell at Row 1 Column 2</Paragraph>
      </TableCell>
      <TableCell Background="Cyan">
        <Paragraph>Cell at Row 1 Column 3</Paragraph>
      </TableCell>
    </TableRow>
    <TableRow>
      <TableCell Background="Cyan">
        <Paragraph>Cell at Row 2 Column 1</Paragraph>
      </TableCell>
      <TableCell Background="Cyan">
        <Paragraph>Cell at Row 2 Column 2</Paragraph>
      </TableCell>
      <TableCell Background="Cyan">
        <Paragraph>Cell at Row 2 Column 3</Paragraph>
      </TableCell>
    </TableRow>
  </TableRowGroup>
</Table>

下圖顯示此範例的轉譯方式。

截圖:表格儲存格間距 截

相較之下,下圖展示了同一表格在預設格距為 2 像素時的渲染方式。

截圖:表格儲存格間距 截

備註

XAML 屬性使用方式

<object property="double"/>
- or -
<object property="qualifiedDouble"/>

XAML 值

雙重Double

字串表示 Double 等於或大於 0.0 但小 PositiveInfinity於的值。 未限定值以裝置獨立像素為單位。 字串不必明確包含小數點。

取得雙重資格如上所述的雙倍值,接著是以下單位指定符之一:px, in, cmpt, ,

px (預設)為裝置無關單位(每單位 1/96 吋)

in 是英吋;1in==96px

cm 是公分;1cm==(96/2.54) px

pt 是分數;1pt==(96/72) px

相依財產資訊

Item 價值觀
識別碼欄位 CellSpacingProperty
元資料屬性設為 true AffectsMeasure

適用於