Devendra174's picture
Upload folder using huggingface_hub
1e92f2d verified
---
title: Tables
description: JSX style props for styling table elements.
---
## Border Spacing
Control the border-spacing property of a table.
```jsx
<chakra.table borderSpacing="2">
<tbody>
<tr>
<td>Cell 1</td>
<td>Cell 2</td>
</tr>
</tbody>
</chakra.table>
```
| Prop | CSS Property | Token Category |
| --------------- | ---------------- | -------------- |
| `borderSpacing` | `border-spacing` | `spacing` |
## Border Spacing X
Use the `borderSpacingX` prop to set the horizontal border-spacing property of a
table.
```jsx
<chakra.table borderSpacingX="2">
<tbody>
<tr>
<td>Cell 1</td>
<td>Cell 2</td>
</tr>
</tbody>
</chakra.table>
```
| Prop | CSS Property | Token Category |
| ---------------- | ---------------- | -------------- |
| `borderSpacingX` | `border-spacing` | `spacing` |
## Border Spacing Y
Use the `borderSpacingY` prop to set the vertical border-spacing property of a
table.
```jsx
<chakra.table borderSpacingY="2">
<tbody>
<tr>
<td>Cell 1</td>
<td>Cell 2</td>
</tr>
</tbody>
</chakra.table>
```
| Prop | CSS Property | Token Category |
| ---------------- | ---------------- | -------------- |
| `borderSpacingY` | `border-spacing` | `spacing` |
## Caption Side
Use the `captionSide` prop to set the side of the caption of a table.
```jsx
<table>
<chakra.caption captionSide="bottom">This is a caption</chakra.caption>
<tbody>
<tr>
<td>Cell 1</td>
<td>Cell 2</td>
</tr>
</tbody>
</table>
```
| Prop | CSS Property | Token Category |
| ------------- | -------------- | -------------- |
| `captionSide` | `caption-side` | - |