{"id":21532405,"url":"https://github.com/jeepeng/react-native-simple-table","last_synced_at":"2025-04-10T00:32:18.974Z","repository":{"id":57340087,"uuid":"74268237","full_name":"Jeepeng/react-native-simple-table","owner":"Jeepeng","description":"A simple table for react native.","archived":false,"fork":false,"pushed_at":"2019-07-25T06:49:31.000Z","size":238,"stargazers_count":32,"open_issues_count":7,"forks_count":13,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-14T11:14:13.880Z","etag":null,"topics":["html-table","react-native","table"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Jeepeng.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-11-20T11:00:38.000Z","updated_at":"2023-08-15T07:28:59.000Z","dependencies_parsed_at":"2022-08-26T04:30:14.116Z","dependency_job_id":null,"html_url":"https://github.com/Jeepeng/react-native-simple-table","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jeepeng%2Freact-native-simple-table","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jeepeng%2Freact-native-simple-table/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jeepeng%2Freact-native-simple-table/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jeepeng%2Freact-native-simple-table/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jeepeng","download_url":"https://codeload.github.com/Jeepeng/react-native-simple-table/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226116562,"owners_count":17576011,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["html-table","react-native","table"],"created_at":"2024-11-24T02:19:50.568Z","updated_at":"2024-11-24T02:19:51.387Z","avatar_url":"https://github.com/Jeepeng.png","language":"JavaScript","readme":"# react-native-simple-table\nA simple table for react native.\n\n![screenshot](screenshots/screenshot.png)\n\n# Installation\n`npm install react-native-simple-table --save`\n\n# Usage\n```js\nimport React, { Component } from 'react'\nimport {\n  Platform,\n  StyleSheet,\n  View,\n  Text\n} from 'react-native'\nimport Table from 'react-native-simple-table'\n\nimport DataFactory from '../mock/DataFactory'\n\nconst columns = [\n  {\n    title: 'Mobile',\n    dataIndex: 'mobile',\n    width: 105\n  },\n  {\n    title: 'Name',\n    dataIndex: 'name',\n    width: 140\n  },\n  {\n    title: 'Age',\n    dataIndex: 'age'\n  },\n  {\n    title: 'Sex',\n    dataIndex: 'sex'\n  },\n];\n\nclass Example extends Component {\n  render() {\n    let dataSource = DataFactory.generate().data;\n    return (\n      \u003cView style={styles.container}\u003e\n        \u003cText style={styles.title}\u003ereact-native-simple-table\u003c/Text\u003e\n        \u003cTable height={320} columnWidth={60} columns={columns} dataSource={dataSource} /\u003e\n      \u003c/View\u003e\n    )\n  }\n}\n\nconst styles = StyleSheet.create({\n  container: {\n    ...Platform.select({\n      ios: {\n        paddingTop: 20\n      },\n      android: {}\n    }),\n  },\n  title: {\n    fontSize: 18,\n    padding: 10,\n    textAlign: 'center'\n  }\n});\n\nexport default Example\n```\n\n```js\nimport mockjs, { Random } from 'mockjs'\n\nexport default class DataFactory {\n  static generate() {\n    return mockjs.mock({\n      'data|1-20': [{\n        'mobile|12300000000-12399999999': 1,\n        'name|1': '@first @last',\n        'age|18-80': 1,\n        'sex|1': () =\u003e Random.pick(['male','female']),\n      }]\n    });\n  }\n}\n```\n\n\n# API\nTable\n\n| Property | Description | Type | Default |\n---|---|---|---\ndataSource | data record array to be rendered | any[] | []\ncolumns | columns of table | Column[] | []\ncolumnWidth | column width | number | 60\nrenderCell | render function | function | undefined\nheight | table height | number | 240\nheaderContainerStyle | header container style | object | {}\nheaderStyle | header text style | object | {}\nbodyContainerStyle | body container style | object | {}\nbodyStyle | body text style | object | {}\n\nColumn\n\n| Property | Description | Type | Default |\n---|---|---|---\ntitle | title of this column | string | -\ndataIndex | display field of the data record | string | -\nwidth | width of this column | number | -\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeepeng%2Freact-native-simple-table","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjeepeng%2Freact-native-simple-table","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeepeng%2Freact-native-simple-table/lists"}