Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

react native Table GridView

Tags:

react-native

how to build table gridview in react native like in picture or in code snippet

enter image description here

<table border=1>
  <tr>
    <th>Firstname</th>
    <th>Lastname</th> 
    <th>Age</th>
  </tr>
  <tr>
    <td>Jill</td>
    <td>Smith</td> 
    <td>50</td>
  </tr>
  <tr>
    <td>Eve</td>
    <td>Jackson</td> 
    <td>94</td>
  </tr>
</table>
like image 821
Alfario Eka Putra Avatar asked Aug 15 '26 17:08

Alfario Eka Putra


1 Answers

You can use ListView component, the first row would be your header (renderHeader), others are rows (renderRow).

Both row and header would be the same component containing a parent View with flexDirection: 'row' with 4 Text components. Each Text component would have a flex: 1 if you want them to be of the same widths.

like image 81
binchik Avatar answered Aug 19 '26 00:08

binchik



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!