> ## Documentation Index
> Fetch the complete documentation index at: https://superdoc-caio-pizzol-docs-ai-core-preset.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# TableCell extension

export const SourceCodeLink = ({extension, path}) => {
  const githubPath = path || `packages/super-editor/src/editors/v1/extensions/${extension.toLowerCase()}`;
  const githubUrl = `https://github.com/superdoc-dev/superdoc/tree/main/${githubPath}`;
  return <div>
      <p>
        <a href={githubUrl} target="_blank" rel="noopener noreferrer">
          View on GitHub →
        </a>
      </p>
    </div>;
};

Cell node for table content. Supports formatting, spans, and borders.

Created automatically by table commands - see [Table extension](/extensions/table).

## OOXML Structure

```xml theme={null}
<w:tc>
  <w:tcPr>
    <w:tcW w:w="2880" w:type="dxa"/>
    <w:cnfStyle w:val="100000000000"/>  <!-- Header cell styling -->
  </w:tcPr>
  <w:p>
    <w:pPr>
      <w:pStyle w:val="TableHeader"/>   <!-- Header paragraph style -->
    </w:pPr>
    <w:r>
      <w:rPr>
        <w:b/>                           <!-- Bold by default -->
      </w:rPr>
      <w:t>Header text</w:t>
    </w:r>
  </w:p>
</w:tc>
```

## Options

Configure the extension behavior:

<ParamField path="htmlAttributes" type="Object" default="{'aria-label':'Table cell node'}">
  HTML attributes for table cells
</ParamField>

## Attributes

Node attributes that can be set and retrieved:

<ParamField path="colspan" type="number" default="1">
  Number of columns this cell spans
</ParamField>

<ParamField path="rowspan" type="number" default="1">
  Number of rows this cell spans
</ParamField>

<ParamField path="colwidth" type="Array<number>" default="[100]">
  Column widths array in pixels
</ParamField>

<ParamField path="background" type="CellBackground">
  Cell background color configuration
</ParamField>

<ParamField path="verticalAlign" type="string">
  Vertical content alignment (top, middle, bottom)
</ParamField>

<ParamField path="cellMargins" type="CellMargins">
  Internal cell padding
</ParamField>

<ParamField path="borders" type="any" required>
  Cell border configuration
</ParamField>

## Types

### `CellBorder`

Cell border configuration

<Expandable title="Properties">
  <ResponseField name="size" type="number">
    Border width in pixels
  </ResponseField>

  <ResponseField name="color" type="string">
    Border color
  </ResponseField>

  <ResponseField name="style" type="string">
    Border style
  </ResponseField>
</Expandable>

### `CellBorders`

Cell borders object

<Expandable title="Properties">
  <ResponseField name="top" type="CellBorder">
    Top border
  </ResponseField>

  <ResponseField name="right" type="CellBorder">
    Right border
  </ResponseField>

  <ResponseField name="bottom" type="CellBorder">
    Bottom border
  </ResponseField>

  <ResponseField name="left" type="CellBorder">
    Left border
  </ResponseField>
</Expandable>

### `CellMargins`

Cell margins configuration

<Expandable title="Properties">
  <ResponseField name="top" type="number">
    Top margin in pixels
  </ResponseField>

  <ResponseField name="right" type="number">
    Right margin in pixels
  </ResponseField>

  <ResponseField name="bottom" type="number">
    Bottom margin in pixels
  </ResponseField>

  <ResponseField name="left" type="number">
    Left margin in pixels
  </ResponseField>
</Expandable>

### `CellBackground`

Cell background configuration

<Expandable title="Properties">
  <ResponseField name="color" type="string" required>
    Background color (hex without #)
  </ResponseField>
</Expandable>

## Source code

<SourceCodeLink path="packages/super-editor/src/editors/v1/extensions/table-cell/table-cell.js" />
