# TableCell Defines individual cells within a Table. ## Import ```tsx import { TableCell } from '@coinbase/cds-web/tables/TableCell' ``` ## Examples ### Basic usage ```tsx live Second Header } title="Bitcoin" subtitle="BTC and I'm like please please truncate me" /> $2,221.01 0.1519581 BTC
``` ### Custom Cell Spacing ```tsx live } title="Bob Smith" subtitle="Junior Developer" /> } title="Alice Smith" subtitle="Senior Developer" />
``` ### Accessibility Example - Multiple Headers ```tsx live
``` ## Props | Prop | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `alignItems` | `ResponsiveProp
` | No | `'center'` | This prop us useful for aligning the last item to the right, or top-aligning cells | | `as` | `td \| th` | No | ``th` when rendered inside a TableHeader, `td` when rendered inside a TableBody or TableFooter` | Use as=th to mark this cell as a header for screen readers | | `dangerouslySetHtmlWidth` | `string \| number` | No | `undefined` | - | | `direction` | `horizontal \| vertical` | No | `vertical` | Direction provides content flow control. Use vertical to inherit a VStask, horizontal for an HStack | | `end` | `ReactElement` | No | `undefined` | Element (icon, asset, image, etc) to display at the end of the cell | | `innerSpacing` | `CellSpacing` | No | `{ spacingHorizontal: 0 }` | The spacing to use on the inner content of Cell | | `justifyContent` | `space-evenly \| FlexAxisValue \| FlexSpaceCommon` | No | `'flex-start'` | This prop us useful for right-aligning the last column | | `onChange` | `FormEventHandler` | No | `-` | - | | `outerSpacing` | `CellSpacing` | No | `-` | The spacing to use on the parent wrapper of Cell | | `overflow` | `clip \| wrap \| truncate \| break` | No | `false` | Should the title/subtitle text truncate | | `start` | `ReactElement` | No | `undefined` | Element (icon, asset, image, etc) to display at the start of the cell | | `subtitle` | `string` | No | `undefined` | A subtitle will appear below the title with font=label2. | | `subtitleColor` | `currentColor \| fg \| fgMuted \| fgInverse \| fgPrimary \| fgWarning \| fgPositive \| fgNegative \| bg \| bgAlternate \| bgInverse \| bgOverlay \| bgElevation1 \| bgElevation2 \| bgPrimary \| bgPrimaryWash \| bgSecondary \| bgTertiary \| bgSecondaryWash \| bgNegative \| bgNegativeWash \| bgPositive \| bgPositiveWash \| bgWarning \| bgWarningWash \| bgLine \| bgLineHeavy \| bgLineInverse \| bgLinePrimary \| bgLinePrimarySubtle \| accentSubtleRed \| accentBoldRed \| accentSubtleGreen \| accentBoldGreen \| accentSubtleBlue \| accentBoldBlue \| accentSubtlePurple \| accentBoldPurple \| accentSubtleYellow \| accentBoldYellow \| accentSubtleGray \| accentBoldGray \| transparent` | No | `-` | - | | `testID` | `string` | No | `-` | Used to locate this element in unit and end-to-end tests. Under the hood, testID translates to data-testid on Web. On Mobile, testID stays the same - testID | | `titleColor` | `currentColor \| fg \| fgMuted \| fgInverse \| fgPrimary \| fgWarning \| fgPositive \| fgNegative \| bg \| bgAlternate \| bgInverse \| bgOverlay \| bgElevation1 \| bgElevation2 \| bgPrimary \| bgPrimaryWash \| bgSecondary \| bgTertiary \| bgSecondaryWash \| bgNegative \| bgNegativeWash \| bgPositive \| bgPositiveWash \| bgWarning \| bgWarningWash \| bgLine \| bgLineHeavy \| bgLineInverse \| bgLinePrimary \| bgLinePrimarySubtle \| accentSubtleRed \| accentBoldRed \| accentSubtleGreen \| accentBoldGreen \| accentSubtleBlue \| accentBoldBlue \| accentSubtlePurple \| accentBoldPurple \| accentSubtleYellow \| accentBoldYellow \| accentSubtleGray \| accentBoldGray \| transparent` | No | `-` | - |