How to create Multi-Columns from data HTML tag in React-pdf

38 Views Asked by At

I'm using react-pdf to display data from html tags, and I want to display the data into two columns. Like the picture below enter image description here

usually when using CSS in React you can use style={{ column: '2 auto' }}. But it doesn't work in react pdf.

this is my code

import { Text, View, Image } from '@react-pdf/renderer';
import Html from 'react-pdf-html';

const ShowPdf = props => {
  const data =
    "<p><b>Lorem Ipsum</b> is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>";
  return (
    <View
      style={{
        columns: '2 auto'
      }}
    >
      <Html>{data}</Html>
    </View>
  );
};

export default ShowPdf;
0

There are 0 best solutions below