React Table Component API
Table API
Explore the API reference for theReact Table component and discover how to effectively utilize its props for customization.
CTable#
import{CTable}from'@coreui/react'// orimportCTablefrom'@coreui/react/src/components/table/CTable'
Property | Default | Type |
---|---|---|
align# | - | string |
Set the vertical aligment. | ||
borderColor# | - | 'primary' ,'secondary' ,'success' ,'danger' ,'warning' ,'info' ,'dark' ,'light' ,string |
Sets the border color of the component to one of CoreUI’s themed colors. | ||
bordered# | - | boolean |
Add borders on all sides of the table and cells. | ||
borderless# | - | boolean |
Remove borders on all sides of the table and cells. | ||
caption# | - | string |
Put the caption on the top if you set | ||
captionTop#4.3.0+ | - | string |
Set the text of the table caption and the caption on the top of the table. | ||
className# | - | string |
A string of all className you want applied to the component. | ||
color# | - | 'primary' ,'secondary' ,'success' ,'danger' ,'warning' ,'info' ,'dark' ,'light' ,string |
Sets the color context of the component to one of CoreUI’s themed colors. | ||
columns#4.3.0+ | - | (string | Column)[] |
Prop for table columns configuration. If prop is not defined, table will display columns based on the first item keys, omitting keys that begins with underscore (e.g. '_props')
| ||
footer#4.3.0+ | - | (string | FooterItem)[] |
Array of objects or strings, where each element represents one cell in the table footer. | ||
hover# | - | boolean |
Enable a hover state on table rows within a | ||
items#4.3.0+ | - | Item[] |
Array of objects, where each object represents one item - row in table. Additionally, you can add style classes to each row by passing them by 'props' key and to single cell by 'cellProps'. | ||
responsive# | - | boolean ,'sm' ,'md' ,'lg' ,'xl' ,'xxl' |
Make any table responsive across all viewports or pick a maximum breakpoint with which to have a responsive table up to. | ||
small# | - | boolean |
Make table more compact by cutting all cell | ||
striped# | - | boolean |
Add zebra-striping to any table row within the | ||
stripedColumns#4.3.0+ | - | boolean |
Add zebra-striping to any table column. | ||
tableFootProps#4.3.0+ | - | CTableFootProps |
Properties that will be passed to the table footer component. | ||
tableHeadProps#4.3.0+ | - | CTableHeadProps |
Properties that will be passed to the table head component. |
CTableBody#
import{CTableBody}from'@coreui/react'// orimportCTableBodyfrom'@coreui/react/src/components/table/CTableBody'
Property | Default | Type |
---|---|---|
className# | - | string |
A string of all className you want applied to the component. | ||
color# | - | 'primary' ,'secondary' ,'success' ,'danger' ,'warning' ,'info' ,'dark' ,'light' ,string |
Sets the color context of the component to one of CoreUI’s themed colors. |
CTableDataCell#
import{CTableDataCell}from'@coreui/react'// orimportCTableDataCellfrom'@coreui/react/src/components/table/CTableDataCell'
Property | Default | Type |
---|---|---|
active# | - | boolean |
Highlight a table row or cell. | ||
align# | - | string |
Set the vertical aligment. | ||
className# | - | string |
A string of all className you want applied to the component. | ||
color# | - | 'primary' ,'secondary' ,'success' ,'danger' ,'warning' ,'info' ,'dark' ,'light' ,string |
Sets the color context of the component to one of CoreUI’s themed colors. |
CTableFoot#
import{CTableFoot}from'@coreui/react'// orimportCTableFootfrom'@coreui/react/src/components/table/CTableFoot'
Property | Default | Type |
---|---|---|
className# | - | string |
A string of all className you want applied to the component. | ||
color# | - | 'primary' ,'secondary' ,'success' ,'danger' ,'warning' ,'info' ,'dark' ,'light' ,string |
Sets the color context of the component to one of CoreUI’s themed colors. |
CTableHead#
import{CTableHead}from'@coreui/react'// orimportCTableHeadfrom'@coreui/react/src/components/table/CTableHead'
Property | Default | Type |
---|---|---|
className# | - | string |
A string of all className you want applied to the component. | ||
color# | - | 'primary' ,'secondary' ,'success' ,'danger' ,'warning' ,'info' ,'dark' ,'light' ,string |
Sets the color context of the component to one of CoreUI’s themed colors. |
CTableHeaderCell#
import{CTableHeaderCell}from'@coreui/react'// orimportCTableHeaderCellfrom'@coreui/react/src/components/table/CTableHeaderCell'
Property | Default | Type |
---|---|---|
className# | - | string |
A string of all className you want applied to the component. | ||
color# | - | 'primary' ,'secondary' ,'success' ,'danger' ,'warning' ,'info' ,'dark' ,'light' ,string |
Sets the color context of the component to one of CoreUI’s themed colors. |
CTableRow#
import{CTableRow}from'@coreui/react'// orimportCTableRowfrom'@coreui/react/src/components/table/CTableRow'
Property | Default | Type |
---|---|---|
active# | - | boolean |
Highlight a table row or cell.. | ||
align# | - | string |
Set the vertical aligment. | ||
className# | - | string |
A string of all className you want applied to the component. | ||
color# | - | 'primary' ,'secondary' ,'success' ,'danger' ,'warning' ,'info' ,'dark' ,'light' ,string |
Sets the color context of the component to one of CoreUI’s themed colors. |