Moaiz Pervaiz
Moaiz Pervaiz

Reputation: 1953

How can we used tables in react.js pdf file

I am downloading pdf file through react.js. I want a static table in pdf file but i can not. How can i add table in pdf HTML using react.js. is there any way to add tables in react.js. How can i implement table into a pdf document file. please help me to solve this problem. I will be very thankful.

Here is the code of my PDF document file which i am rendering.

import {
 Table,
 TableBody,
 TableHeader,
 TableHeaderColumn,
 TableRow,
 TableRowColumn,
 } from 'material-ui/Table';

<Table>
  <TableHeader>
    <TableRow>
     <TableHeaderColumn>ID</TableHeaderColumn>
     <TableHeaderColumn>Name</TableHeaderColumn>
     <TableHeaderColumn>Status</TableHeaderColumn>
  </TableRow>
</TableHeader>
<TableBody>
  <TableRow>
    <TableRowColumn>1</TableRowColumn>
    <TableRowColumn>John Smith</TableRowColumn>
    <TableRowColumn>Employed</TableRowColumn>
  </TableRow>
</TableBody>

Upvotes: 0

Views: 333

Answers (1)

user11707511
user11707511

Reputation:

PDF File can not read external css. Its read only Inline CSS. You are using react material. Its calling an external css. So PDF not affecting the designs. Try to write css in inline.

Upvotes: 1

Related Questions