react-native-simple-table
A simple table for react native.
Installation
npm install react-native-simple-table --save
Usage
const columns = title: 'Mobile' dataIndex: 'mobile' width: 105 title: 'Name' dataIndex: 'name' width: 140 title: 'Age' dataIndex: 'age' title: 'Sex' dataIndex: 'sex' ; { let dataSource = DataFactorydata; return <View style=stylescontainer> <Text style=stylestitle>react-native-simple-table</Text> <Table height=320 columnWidth=60 columns=columns dataSource=dataSource /> </View> } const styles = StyleSheet;
static { return mockjs; }
API
Table
Property | Description | Type | Default |
---|---|---|---|
dataSource | data record array to be rendered | any[] | [] |
columns | columns of table | Column[] | [] |
columnWidth | column width | number | 60 |
renderCell | render function | function | undefined |
height | table height | number | 240 |
Column
Property | Description | Type | Default |
---|---|---|---|
title | title of this column | string | - |
dataIndex | display field of the data record | string | - |
width | width of this column | number | - |