
Security News
GitHub Actions Checkout Now Blocks Risky pull_request_target Checkouts
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.
react-component-data-table
Advanced tools
required: true
type: arrayOf shape
shape
name
className
style
render
required: false
type: array
defaultValue: []
required: false
type: object
defaultValue: { width: "100%" }
required: false
type: any
defaultValue: 'pure-table pure-table-striped'
required: false
type: func
defaultValue: (definedColumn)=>(<tr> <td colSpan={definedColumn.length} style={{textAlign:"center"}}>NO DATA</td> </tr>)
Extends PureComponent
数据Table
Examples
Simple
class SimpleDataTableDemo extends React.PureComponent{
render(){
const dataSource=[
{name:"name1",sex:"male"},
{name:"name2",sex:"female"}
];
const columns=[
{name:"Name",render:rowData=>rowData['name']},
{name:"Sex",render:rowData=>rowData['sex']},
];
return <DataTable columns={columns} dataSource={dataSource}></DataTable>
}
}
Empty
class EmptyDataTableDemo extends React.PureComponent{
render(){
const dataSource=[];
const columns=[
{name:"Name",render:rowData=>rowData['name']},
{name:"Sex",render:rowData=>rowData['sex']},
];
return <DataTable columns={columns} dataSource={dataSource}></DataTable>
}
}
Radio DataTable
class RadioDataTableDemo extends React.PureComponent{
render(){
const dataSource=[
{name:"name1",sex:"male"},
{name:"name2",sex:"female"}
];
const columns=[
{name:"",render:rowData=>{
return <input type="radio" value={rowData['name']} name="radio-data-table"/>
}},
{name:"Name",render:rowData=>rowData['name']},
{name:"Sex",render:rowData=>rowData['sex']},
];
return <DataTable columns={columns} dataSource={dataSource}></DataTable>
}
}
Checkbox DataTable
class CheckboxDataTableDemo extends React.PureComponent{
render(){
const dataSource=[
{name:"name1",sex:"male"},
{name:"name2",sex:"female"}
];
const columns=[
{name:"",render:rowData=>{
return <input type="checkbox" value={rowData['name']}/>
}},
{name:"Name",render:rowData=>rowData['name']},
{name:"Sex",render:rowData=>rowData['sex']},
];
return <DataTable columns={columns} dataSource={dataSource}></DataTable>
}
}
定义数据列
数据源
样式
css class
定义没有数据时的样式
FAQs
<!-- badge -->
The npm package react-component-data-table receives a total of 3 weekly downloads. As such, react-component-data-table popularity was classified as not popular.
We found that react-component-data-table demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.