<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Solomon Lee</title>
    <description>The latest articles on DEV Community by Solomon Lee (@tekhxdev).</description>
    <link>https://dev.to/tekhxdev</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4281766%2Fc1b0a029-1df6-45c1-b6de-c9ef80c9b522.jpg</url>
      <title>DEV Community: Solomon Lee</title>
      <link>https://dev.to/tekhxdev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tekhxdev"/>
    <language>en</language>
    <item>
      <title>How we built print-ready tables in React (without a PDF library)</title>
      <dc:creator>Solomon Lee</dc:creator>
      <pubDate>Fri, 04 Dec 2026 04:11:33 +0000</pubDate>
      <link>https://dev.to/tekhxdev/how-we-built-print-ready-tables-in-react-without-a-pdf-library-2fao</link>
      <guid>https://dev.to/tekhxdev/how-we-built-print-ready-tables-in-react-without-a-pdf-library-2fao</guid>
      <description>&lt;p&gt;Every business app ends up with the same request: "Can I print this list?" The obvious answers are both bad.&lt;br&gt;
&lt;code&gt;window.print()&lt;/code&gt; on the screen gives you a sidebar, a toolbar and a table cut in half across pages. A PDF library&lt;br&gt;
means a second rendering engine, a second layout to keep in sync with the screen, and a big bundle.&lt;/p&gt;

&lt;p&gt;We needed something better for the data table in Tekhx UI, because our users print constantly: overdue invoices&lt;br&gt;
for a collections call, stock counts for the warehouse, payroll registers for sign-off. Here is the approach we&lt;br&gt;
landed on. It uses nothing but the DOM, CSS and the browser's own print dialog, and every idea in it works in&lt;br&gt;
any framework.&lt;/p&gt;
&lt;h3&gt;
  
  
  What "print-ready" has to mean
&lt;/h3&gt;

&lt;p&gt;We wrote the requirements down first, because each one rules out a shortcut:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Real pages.&lt;/strong&gt; A4 or Letter, with margins. The preview on screen must be exactly what the printer gets.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The header row on every page.&lt;/strong&gt; Page 3 of a 6-page list is useless without its column names.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A row never splits.&lt;/strong&gt; Half a row at the foot of a page and half at the top of the next is unreadable.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Totals and the row count on the last page only.&lt;/strong&gt; They must share that page with at least one row; a
totals line alone on a blank page looks like a bug.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;"Page 2 of 5" on every page.&lt;/strong&gt; And the filters in force written out ("Status: Overdue · Amount: at least
$2,000"), so a loose sheet still says what it is.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The right orientation.&lt;/strong&gt; A ten-column table squeezed onto an upright page is worse than no report.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;CSS paged media covers part of this: &lt;code&gt;thead { display: table-header-group }&lt;/code&gt; repeats the header in most browsers,&lt;br&gt;
and &lt;code&gt;break-inside: avoid&lt;/code&gt; on rows is mostly respected. But "Page n of N", totals pinned to the last page and an&lt;br&gt;
exact on-screen preview are where pure CSS runs out. So we lay the pages out ourselves.&lt;/p&gt;
&lt;h3&gt;
  
  
  Step 1: measure, don't guess
&lt;/h3&gt;

&lt;p&gt;The report renders once off-screen as a single unbounded page: the letterhead, the title block, the header row,&lt;br&gt;
every body row, the totals and the closing line. Then we read real heights:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;rowHeights&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;root&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelectorAll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"tbody tr"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;tr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getBoundingClientRect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;height&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;scale&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two details matter here. First, &lt;strong&gt;divide by the scale&lt;/strong&gt;. If the page is zoomed or an ancestor is transformed,&lt;br&gt;
&lt;code&gt;getBoundingClientRect&lt;/code&gt; reports scaled pixels. We compare the rendered page width against its true width in CSS&lt;br&gt;
pixels (&lt;code&gt;210mm × 96/25.4&lt;/code&gt; for A4) and divide by the ratio.&lt;/p&gt;

&lt;p&gt;Second, &lt;strong&gt;wait for fonts&lt;/strong&gt;. A row measured in the fallback font is shorter or taller than the same row in the real&lt;br&gt;
one. We re-run the measurement when &lt;code&gt;document.fonts.ready&lt;/code&gt; resolves.&lt;/p&gt;

&lt;p&gt;From the measurements we get the room for rows on each page:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;room&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pageHeight&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;padding&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;footer&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;headerRow&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;slack&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;first&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;room&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;letterheadAndTitle&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   &lt;span class="c1"&gt;// page one carries the letterhead&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;rest&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;room&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;runningHead&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;          &lt;span class="c1"&gt;// later pages carry a one-line running head&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;tail&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;totals&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;closingLine&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;        &lt;span class="c1"&gt;// what the last page must still fit&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;slack&lt;/code&gt; is a few millimetres of safety. Screen and printer round differently, and without it one row in a&lt;br&gt;
hundred spills onto a page of its own.&lt;/p&gt;
&lt;h3&gt;
  
  
  Step 2: pack rows into pages
&lt;/h3&gt;

&lt;p&gt;With heights in hand, pagination is a small greedy loop:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;paginate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;heights&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;number&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;first&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;number&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;rest&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;number&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tail&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;number&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;pages&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Array&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;number&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;number&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;start&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;used&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;room&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;first&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;heights&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;start&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;used&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;room&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;pages&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;start&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;used&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;room&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;rest&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="n"&gt;used&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="c1"&gt;// The totals must share the last page with at least one row.&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;heights&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;used&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;tail&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;room&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;heights&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;start&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;pages&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;heights&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;start&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;heights&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="n"&gt;pages&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;heights&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;pages&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;i &amp;gt; start&lt;/code&gt; guard means a single row taller than a page still gets a page of its own instead of looping&lt;br&gt;
forever. The tail check handles requirement 4: if the totals don't fit after the last rows, we carry the final row&lt;br&gt;
over so the totals have company. It is a pure function, so it is trivial to unit-test with made-up heights.&lt;/p&gt;
&lt;h3&gt;
  
  
  Step 3: render the pages as pages
&lt;/h3&gt;

&lt;p&gt;Now we render each &lt;code&gt;[start, end)&lt;/code&gt; range as its own page element at the paper's exact size: a &lt;code&gt;&amp;lt;table&amp;gt;&lt;/code&gt; with the&lt;br&gt;
header row, that slice of rows, and on the last page the totals. Page one gets the letterhead and title; later&lt;br&gt;
pages get a running head. Each foot says "Generated Dec 4, 2026 · Page 2 of 5". Because we produced the pages, we&lt;br&gt;
know N.&lt;/p&gt;

&lt;p&gt;The preview dialog shows these same elements, scaled to fit the window. Printing hands them to the browser with a&lt;br&gt;
print stylesheet that sets &lt;code&gt;@page { size: A4; margin: 0 }&lt;/code&gt; (the margins live inside our page elements) and forces&lt;br&gt;
a page break after each one. The user prints, or chooses "Save as PDF" in the browser's dialog. No PDF library,&lt;br&gt;
and no second layout to drift out of sync.&lt;/p&gt;
&lt;h3&gt;
  
  
  Step 4: decide the orientation from the columns
&lt;/h3&gt;

&lt;p&gt;Each column gets a natural width from its content. We use the 90th-percentile cell length rather than the&lt;br&gt;
longest, so one long note doesn't widen the column for everyone. Numbers and dates never wrap, and the bold&lt;br&gt;
totals line is never cut. If the sum is wider than the upright page's printable width, the report turns&lt;br&gt;
landscape on its own. The viewer can still switch it, and switch between A4 and Letter. The default paper comes&lt;br&gt;
from the locale: Letter for the US, Canada, Mexico, the Philippines and a few others, A4 everywhere else.&lt;/p&gt;
&lt;h3&gt;
  
  
  What the cell prints
&lt;/h3&gt;

&lt;p&gt;The screen and the paper want different things from a cell. On screen a status is a coloured badge and a customer&lt;br&gt;
is an avatar plus a name. On paper we print the &lt;em&gt;word&lt;/em&gt;: a pick list prints its label, a badge column prints its&lt;br&gt;
text, money is formatted and right-aligned with tabular figures. Each column can supply its own export value, and&lt;br&gt;
the same function feeds the PDF report, the CSV and the Excel file, so the three always agree.&lt;/p&gt;
&lt;h3&gt;
  
  
  Results
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;One rendering path. The preview &lt;em&gt;is&lt;/em&gt; the print.&lt;/li&gt;
&lt;li&gt;No dependency. The table's bundle does not grow with a PDF engine.&lt;/li&gt;
&lt;li&gt;It works for 5 rows or 5,000. Measuring is one layout pass; packing is linear.&lt;/li&gt;
&lt;li&gt;The same page shell prints our invoices, receipts and payslips, so every paper in the app looks like it came from
the same office.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Try it
&lt;/h3&gt;

&lt;p&gt;The data table in Tekhx UI does all of this behind one prop:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;DataTable&lt;/span&gt; &lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"Invoices"&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;rows&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="n"&gt;columns&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;columns&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="n"&gt;exportable&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;company&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Acme"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;addressLines&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"…"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;phone&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;taxId&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;paper&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"a4"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can press Export › PDF report on the live table in the docs (link below). The approach itself is yours to copy: measure, pack, render pages, let the browser print.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Try the table and its PDF export live: &lt;a href="https://ui.tekhx.com/docs/data-table/?utm_source=devto&amp;amp;utm_medium=article" rel="noopener noreferrer"&gt;Tekhx UI data table docs&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>css</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
