> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stac.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# TableCell

> Documentation for TableCell

export const PLAYGROUND_BASE_URL = "https://playground.stac.dev/";

export const tableCellPreviewJson = {
  "type": "tableCell",
  "verticalAlignment": "top",
  "child": {
    "type": "container",
    "color": "#40000000",
    "height": 50,
    "child": {
      "type": "center",
      "child": {
        "type": "text",
        "data": "Header 1"
      }
    }
  }
};
export const tableCellPreviewSrc = `${PLAYGROUND_BASE_URL}/embed`;

StacTableCell allows you to define the Flutter TableCell widget using JSON.
To know more about the TableCell widget in Flutter, refer to the [official documentation](https://api.flutter.dev/flutter/widgets/TableCell-class.html).

## Properties

| Property          | Type                          | Description                                                                                                                                   |
| ----------------- | ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| verticalAlignment | `TableCellVerticalAlignment?` | Defines the verticalAlignment for the table cell. Can be `top`, `middle`, `bottom`, `baseline`, `fill` & `intrinsicHeight` Defaults to `top`. |
| child             | `Map<String, dynamic>`        | The child widget of the table cell.                                                                                                           |

## Example

<Tabs sync={false}>
  <Tab title="Dart">
    ```dart theme={null}
    StacTableCell(
      verticalAlignment: StacTableCellVerticalAlignment.top,
      child: StacContainer(
        color: '#40000000',
        height: 50.0,
        child: StacCenter(
          child: StacText(data: 'Header 1'),
        ),
      ),
    )
    ```
  </Tab>

  <Tab title="JSON">
    ```json theme={null}
    {
      "type": "tableCell",
      "verticalAlignment": "top",
      "child": {
        "type": "container",
        "color": "#40000000",
        "height": 50,
        "child": {
          "type": "center",
          "child": {
            "type": "text",
            "data": "Header 1"
          }
        }
      }
    }
    ```
  </Tab>

  <Tab title="Preview">
    <Frame>
      <iframe
        id="stac"
        src={tableCellPreviewSrc}
        title="Stac Playground"
        className="w-full rounded-xl border-0"
        style={{ height: "640px" }}
        loading="lazy"
        onLoad={(event) => {
      const iframe = event.currentTarget;
      const targetOrigin = PLAYGROUND_BASE_URL;
      const message = {
        type: "stac-preview-json",
        payload: tableCellPreviewJson
      };

      let attempts = 0;
      const maxAttempts = 12;
      const interval = setInterval(() => {
        iframe.contentWindow?.postMessage(message, targetOrigin);
        attempts += 1;

        if (attempts >= maxAttempts) {
          clearInterval(interval);
        }
      }, 250);
    }}
      />
    </Frame>
  </Tab>
</Tabs>
