A Bootstrap 6 invoice table styled as a printed sheet: company header, billing details, line items, a discount, a selectable tax rate and a bold total. It suits client portals, billing pages in SaaS dashboards and freelancer or agency tools.
How it works
.ivt-root wraps an .ivt-sheet article. Below the header, a <dl class="ivt-meta"> lists the client, issue date, due date and project. The table sits in a .table-responsive wrapper. Each tr.ivt-line has a row header with the item name and note, an editable .ivt-qty number input, a .ivt-rate cell whose price is in data-ivt-rate, a tax marker and an .ivt-amount cell. data-ivt-taxable="false" marks pass-through costs, such as hosting, as exempt.
script.js recalculates everything on every input and change event in the table body and on the .ivt-tax-rate select:
- Each amount is quantity × rate, and they add up to the subtotal.
- The discount percentage comes from
data-ivt-discounton.ivt-discount. - Tax applies only to the taxable lines, after the discount.
- The result fills
.ivt-subtotal,.ivt-discount,.ivt-taxand.ivt-total.
All money uses Intl.NumberFormat.
The issue date is today and the due date is today plus data-ivt-due-days, so the sample never shows stale dates. Add line inserts an .ivt-line--new row with description, quantity, rate and taxable inputs. The × buttons remove a line and move focus to the next one. Download PDF and Send invoice are simulated. Send shows a spinner and then reports through the .ivt-status live region.
Below 600 px each line item turns into a two-row block (name on top; quantity, rate, tax and amount below), and the totals become simple label/value rows.
Customization
--ivt-greenon.ivt-root: the brand color for the top border, column headers, the checked tax box, the total and the Send button.--ivt-paper,--ivt-deskand--ivt-ruleon.ivt-root: the sheet, background and divider colors.--ivt-serifon.ivt-root: the font used for the company name, title and total.data-ivt-due-daysanddata-ivt-currencyon.ivt-root: payment terms and currency (for example30andEUR).data-ivt-discounton.ivt-discount: the discount percentage. Set it to0and delete the row if you do not offer discounts.- Add or change
<option>values in.ivt-tax-rateto match your local tax rates. - Replace the
setTimeoutin the Send handler with afetch()POST to your invoicing API.
Use cases
- Freelancers and agencies: editable quantities update the line totals as you type
- Small business billing: taxable and exempt items are handled with a selectable tax rate
- Quotes and estimates: a discount field adjusts the subtotal and grand total live
- Billing portals: a paper-style sheet looks like a printed invoice
Accessibility
The table has a hidden caption and row headers (th scope="row") for each item. Every quantity input has an aria-label naming its item, and every remove button names the line it deletes. Tax markers are role="img" with a label. The tax select has a visible <label>, and dates use <time datetime>. The send result is read out through role="status".
Bootstrap 6 notes
The tax rate uses form-control on a <select>, because form-select is gone in Bootstrap 6. Buttons use btn-solid, btn-outline and btn-text with theme-* roles, the due badge is badge badge-subtle theme-warning, and the loading state uses spinner-sm. Built on Bootstrap 6.0.0-alpha.1, so APIs may still change.