Найден простой способ создать вашу таблицу, для этого я использую act-native-table-component .
import React, { Component } from "react";
import { StyleSheet, View } from 'react-native';
import { Table, TableWrapper, Row, Rows } from 'react-native-table-component';
export default class App extends Component {
constructor(props) {
super(props);
this.state = {
tableHead: ['SL#', 'Name'],
tableData: [
['1', 'ab'],
['2', 'gh'],
['3', 'asdf'],
]
}
}
render() {
const state = this.state;
return (
<View style={styles.container}>
<Table>
<Row data={state.tableHead} flexArr={[1, 1]} style={styles.head} textStyle={styles.text} />
<TableWrapper style={styles.wrapper}>
<Rows data={state.tableData} flexArr={[1, 1]} style={styles.row} textStyle={styles.text} />
</TableWrapper>
</Table>
</View>
)
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
padding: 16,
paddingTop: 30,
backgroundColor: '#fff'
},
head: {
height: 40,
backgroundColor: '#f1f8ff'
},
wrapper: {
flexDirection: 'row'
},
title: {
flex: 1, backgroundColor: '#f6f8fa'
},
row: {
height: 28
},
text: {
textAlign: 'center'
}
});
Подробнее вы можете прочитать здесь: https://www.npmjs.com/package/react-native-table-component