1.0.2 • Published 6 years ago

react-native-table-simple-version v1.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

react-native-simpletable

a simple table for react native

Props

Data

  • header like this ['id', 'name']
  • body like this [[1, 'apple'], [2, 'banana'], [3, 'pineapple']]

example

import React, { Component } from 'react'
import { StyleSheet, SafeAreaView } from 'react-native'
import Table from 'react-native-table-simple-version'

export default class App extends Component {
  constructor(props) {
    super(props)
    this.state = {
      header: ['id', 'name'],
      body: [[1, 'apple'], [2, 'banana'], [3, 'pineapple']],
    }
  }

  render() {
    return(
      <SafeAreaView style={styles.container}>
        <Table header={this.state.header} body={this.state.body}/>
      </SafeAreaView>
    )
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#f2f2f2',
  },
})