dmk99 / react-pdf-table

Storybook Available
https://dmk99.github.io/react-pdf-table
MIT License
152 stars 62 forks source link

Can we achieve two tables side by sides in a single render #39

Closed sr2399 closed 2 years ago

sr2399 commented 3 years ago

Hi I want to achieve side by side in a single page and also the data should start where its ending on the left table. i.e. I want data continuing from the end of the left table

dmk99 commented 2 years ago

In theory you should be able to achieve this, you would just need to use the react-pdf/renderer View components with a style taking 50% of the screen. You could then split up your table data in half and create two Tables.

This is just an example of what it could look like, I have not tested this:

<PDFViewer>
    <Document>
        <Page>
            <View>
                <Table data={firstHalfArray}>
                </Table>
            </View>
            <View>
                <Table data={secondHalfArray}>
                </Table>
            </View>
        </Page>
    <Document>
</PDFViewer>