Skip to content

Printable Invoice Layout

Tailwind CSS invoice with line items, auto-calculated discount, tax and balance due, a print button and print-friendly A4 styles.

Also known as: invoice layout, printable invoice, invoice page, billing statement design

Printable Invoice Layout live demo

Open in new tab

Tailwind CSS code (HTML, CSS, JS)

A clean, printable invoice layout built with Tailwind CSS and a small vanilla JavaScript helper that recalculates line amounts, discount, tax and balance due. Use it for customer account pages, order history details, freelancer billing tools or any admin screen where an invoice has to look right on screen and on paper.

How it works

The root is .inv-invoice. It starts with the .inv-actions toolbar (invoice number, an Edit link and the data-inv-print button), followed by the article.inv-sheet paper. The sheet has a header with the sender's logo and address, the large "Invoice" title with number and status pill, and a thick border-teal-800 rule. A four-column dl holds bill-to details, dates and project. Line items sit in a real table inside .inv-table-wrap, which scrolls horizontally on narrow phones instead of squeezing columns. Payment details and notes sit next to the .inv-totals list, which ends with the highlighted .inv-balance box.

All amounts are written in the HTML, so the invoice is complete without JavaScript. On DOMContentLoaded the script reads data-qty and data-rate from each data-inv-item row, plus data-inv-tax-rate, data-inv-discount and data-inv-paid from the root. It formats everything with Intl.NumberFormat using data-inv-locale and data-inv-currency, then fills data-inv-amount, data-inv-subtotal, data-inv-tax, data-inv-total and data-inv-balance. The print button calls window.print().

In style.css, the @media print block hides .inv-actions, removes the grey page background, shadow and rounding, lets the table expand fully, repeats the table header on each page and keeps rows and totals from splitting. @page sets A4 with 14 mm margins, and print-color-adjust: exact keeps the teal rule and balance box in color.

Customization

  • data-inv-currency and data-inv-locale on .inv-invoice: switch to EUR and de-DE, for example, to get 7.660,00 € formatting everywhere.
  • data-inv-tax-rate: set the rate as a decimal (0.2 for 20%); the label in data-inv-tax-label updates automatically.
  • data-inv-discount and data-inv-paid: set fixed amounts, or use 0 and delete their rows from .inv-totals.
  • Add a line item: copy a tr with data-inv-item and change its data-qty and data-rate; the totals follow.
  • bg-teal-800 and border-teal-800: replace teal with your brand color for the header rule, button and balance box.
  • size: A4 in the @page rule: change to letter for US paper, and adjust margin to suit your printer.
  • bg-amber-100 and text-amber-800 on the status pill: use green for "Paid" or red for "Overdue".

Use cases

  • Customer account pages: order history details show an invoice with line items, tax and balance due
  • Freelancer billing tools: discount, tax and totals are calculated automatically from quantity and rate
  • Admin screens: a print button produces a clean A4 page with the toolbar hidden
  • Multi-currency shops: currency and locale settings change how every amount is formatted

Accessibility

The invoice uses semantic markup: an article labelled by #inv-title, an address for the sender, description lists for metadata and totals, and a table with a hidden caption and scope="col" headers. The scrollable table wrapper is a focusable role="region" with an aria-label, so keyboard users can scroll it and see a focus outline. Buttons and links show visible focus rings, decorative SVGs are aria-hidden, and if window.print() throws, a message appears in the role="status" region.

Usage notes

@page applies to the whole document, so keep the invoice on its own page. Inside sandboxed preview iframes the print dialog can be blocked; it works on a normal page.

Printable Invoice Layout at a glance

Framework
Tailwind CSS
Code
HTML, CSS, JavaScript
JavaScript
Vanilla JavaScript, no jQuery
Dependencies
Tailwind CSS
Layout
Responsive, works on mobile
Category
Order History
License
Free for personal and commercial use

Questions about this template

Can I use the Printable Invoice Layout code for free?

Yes. You can copy or download the code and use it in personal and commercial projects, including client work. No sign-up is needed. Reselling it as part of a component library or template collection is not allowed; see the license.

How do I add it to my website?

Load Tailwind CSS from a CDN (the links are under Requirements). Paste the HTML where the component should appear, add the CSS to your stylesheet and load the JavaScript before the closing </body> tag. Download HTML gives you a complete page with everything already linked.

Does it need jQuery or a JavaScript framework?

No. The script is plain vanilla JavaScript, so it works without jQuery, React or Vue. You can still use the markup inside those frameworks.

Does it work on mobile?

Yes. The layout adapts to small screens. Use the Mobile and Tablet buttons above the live demo to check it at phone and tablet width.

Requirements

Add these to your page (already included in the download):

  • <script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>

The Tailwind browser build is for prototyping. In production, compile Tailwind with its CLI or your bundler.

Printable Invoice Layout – Tailwind CSS order history component screenshot
Printable Invoice Layout · Tailwind CSS Order History

More Order History

Order Details Page with Product Photos – Bootstrap 5 order history preview

Order Details Page with Product Photos

Bootstrap 5 order details page with product photos, delivery progress tracker, price summary, shipping address, copy order number and buy-again toast.

Order History – Tailwind CSS order history preview

Order History

Tailwind CSS order history list with status filter chips, colored status badges and expandable order details.