CellSpacing Property
Collapse the table of content
Expand the table of content

Table::CellSpacing Property

 

Gets or sets the amount of spacing between cells in a table.

Namespace:   System.Windows.Documents
Assembly:  PresentationFramework (in PresentationFramework.dll)

public:
[TypeConverterAttribute((LengthConverter^::typeid))]
property double CellSpacing {
	double get();
	void set(double value);
}

Property Value

Type: System::Double

The amount of spacing between cells in a table, in device independent pixels.

The default value is 2.0.

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

double

Double

String representation of a Double value equal to or greater than 0.0 but smaller than PositiveInfinity. An unqualified value is measured in device independent pixels. Strings need not explicitly include decimal points.

qualifiedDouble

A double value as described above, followed by one of the following unit specifiers: px, in, cm, pt.

px (default) is device-independent units (1/96th inch per unit)

in is inches; 1in==96px

cm is centimeters; 1cm==(96/2.54) px

pt is points; 1pt==(96/72) px

Identifier field

CellSpacingProperty

Metadata properties set to true

AffectsMeasure

The following example defines a simple 2 x 3 table with a CellSpacing of 0.35 centimeters.

<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>

The following figure shows how this example renders.

Screenshot: Table cell spacing

In contrast, the following figure shows how the same table renders with a default cell spacing of 2 pixels.

Screenshot: Table cell spacing

.NET Framework
Available since 3.0
Return to top
Show:
© 2016 Microsoft