React PDF Table Example
Tested on: Firefox 86.0 (Ubuntu) and Chrome Version 89.0.4389.82 (64-bit) (Ubuntu)
Let me know if you guys enjoyed it ✌️
I've seen people asking everywhere how the hell can you build a Table in react-pdf. The sad truth is that there is still no official component on the library that does it for you. However it doesn't mean that it's not possible, in fact it's not even hard, you just need to get dirty in a tiny bitty of CSS.
In this repository I've built a simple example that shows how you can use <View>, <Text> and some ninja CSS to easily mimic the appearance of a table.
- Clone the repository
- In the terminal go to the repository folder:
cd react-pdf-table-example
- Install the dependencies using yarn or npm, whichever you like:
yarn install
ornpm install
- Start the project with:
yarn start
ornpm start
- The project will run automatically on
http://localhost:3000/
The example renders the table on the browser, and should look something similar to this: