Giter Site home page Giter Site logo

enescang / react-pdf-table Goto Github PK

View Code? Open in Web Editor NEW
13.0 1.0 3.0 82 KB

Simple table generator for @react-pdf/renderer

Home Page: https://www.npmjs.com/package/react-pdf-table

JavaScript 100.00%
reactjs react-pdf react-pdf-table react-components pdf-table

react-pdf-table's Introduction

React PDF Table Generator

๐Ÿ Getting Started

react-pdf-table is super simple table generator for @react-pdf/renderer

โœ”๏ธ Install

npm install react-pdf-table --save

๐Ÿ“’Usage

This package has only 2 main component for creating table. These are TableRow and TableCell.

Import

import ReactPdfTable from "react-pdf-table";

Create Simple Row

Any number of cells can be created in a row.

	...
	<ReactPdfTable.TableRow>
		<ReactPdfTable.TableCell  text="Cell 1"  align="right" />
		<ReactPdfTable.TableCell  text="Cell 1"  align="center" />
		<ReactPdfTable.TableCell  text="Cell 1"  align="left" />
	</ReactPdfTable.TableRow>
	...

Actually, that's all. Also react-pdf-table is supporting nested tables.

Nested Table

<ReactPdfTable.TableRow>
	<ReactPdfTable.TableRow width={70} disableMargin={true}>
		<ReactPdfTable.TableCell text="1" align="center" width={57}  />
		<ReactPdfTable.TableCell text="2" align="center" />
		<ReactPdfTable.TableCell text="3" align="right" />
	</ReactPdfTable.TableRow>
<ReactPdfTable.TableCell text="Name1" align="center"  />
<ReactPdfTable.TableCell text="Name2" align="right"  />
<ReactPdfTable.TableCell text="Name3" align="right"  />
</ReactPdfTable.TableRow>

//Rest of document will be ready ASAP.

Written with StackEdit.

react-pdf-table's People

Contributors

enescang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

react-pdf-table's Issues

Consolidating react-pdf table packages

While searching npm for a library that renders tables using @react-pdf/renderer, our team noticed several (12!) very similar packages. We identified that most need more maintenance, testing, or support. To address this, we released @ag-media/react-pdf-table, which we are committed to supporting as we actively use it in our commercial projects.

It's fantastic to see the different approaches and functionalities each package brings to the table. Our community thrives on innovation, and it's inspiring to witness the variety of solutions available.

However, we believe that merging our efforts and packages into a single, more flexible, comprehensive tool would greatly benefit developers. By consolidating our packages, we can eliminate confusion and provide a reliable solution with a stronger community. Let's work together to consolidate our packages, ensuring that developers can easily find the right solution without searching through multiple repositories.

Please share your thoughts, and let's discuss the details of merging our packages, including adding additional guides, examples or tests. Together, we can create a package that simplifies the developer experience and benefits the entire community.

We are looking forward to your response and the possibility of joining forces!

Not working in my next js project

./node_modules/react-pdf-table/dist/utils.js:8:0
Module not found: Can't resolve 'core-js/modules/es.object.assign.js'

Import trace for requested module:
./node_modules/react-pdf-table/dist/components/TableRow/index.js
./node_modules/react-pdf-table/dist/index.js
./src/components/ConsignmentReport/MyDoc.js
./src/pages/dashboard/consignmentReports/index.js

https://nextjs.org/docs/messages/module-not-found

I found this error over and over. Please do something.

Npm install is not working properly

There is no backgroundColor props even after I installed the latest version of the package. Can you please look into it
You can try the same but run npm i react-pdf-table in another project

Can we pass multiple props to the text in TableCell component?

Hello,
I would like to pass multiple props to the text attribute. Is it possible, and how to achieve it?

Example:
I want to pass data.page9.hypersensibility and data.page9.valueOfHypersensibility and separate them with a colon (:) as props to the text attribute below.

<ReactPdfTable.TableRow>
<ReactPdfTable.TableCell text={t("result.row2_header")} align="center" />
<ReactPdfTable.TableCell text={data.page9.hypersensibility: data.page9.valueOfHypersensibility} align="center" />
<ReactPdfTable.TableCell text="hello" align="center" />
</ReactPdfTable.TableRow>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.