A stockist table for a website page
A local brand wants a where-to-buy table on its site. The CSV has an ampersand, a pipe and an empty cell. A caption and a CSS class are added in the options.
The output uses thead and tbody, gives each header cell scope="col" for screen readers, and escapes the ampersand as &. The caption appears above the table. The class lets the site's stylesheet style it without inline styles.
business,town,reviews Kiln & Co Pottery,Frome,48 "Marlow Print | Design",Bath,112 Oak Lane Joinery,Frome, Caption: Frome and Bath stockists CSS class: stockists
<table class="stockists">
<caption>Frome and Bath stockists</caption>
<thead>
<tr><th scope="col">business</th><th scope="col">town</th><th scope="col">reviews</th></tr>
</thead>
<tbody>
<tr><td>Kiln & Co Pottery</td><td>Frome</td><td>48</td></tr>
<tr><td>Marlow Print | Design</td><td>Bath</td><td>112</td></tr>
<tr><td>Oak Lane Joinery</td><td>Frome</td><td></td></tr>
</tbody>
</table>Building the markup
Paste the CSV
Paste text or cells copied from a spreadsheet. Set the separator if detection gets it wrong.
Header or not
With First row is a header (<th> cells) ticked, row one becomes the thead. Untick it for a table of data cells only.
Add a caption and class
Both are optional. The caption describes the table for everyone, including screen reader users. The class is for your own CSS.
Check the preview and copy
The preview below the output shows the rendered table. Copy the HTML or download table.html.
The parts of the markup
- caption
- A title for the table, read out by screen readers before the data.
- thead and tbody
- Separate the header row from the data rows, which helps styling, printing and accessibility.
- th scope="col"
- Marks a header cell as the label for its column, so assistive technology can announce it with each value.
- Escaping
- Characters such as & and < are written as entities so they display as text rather than being read as HTML.
Using it in a CMS or an email
Most website builders, including WordPress, Squarespace and Wix, have an HTML or code block. Paste the markup there and the table takes on the site's default table styles. Add a class and a few lines of CSS if you want borders or striped rows.
Email clients are fussier. The plain markup displays in most of them, but styling through a class is often stripped, so if you need borders in an email, add simple inline styles to the table and cells after copying. Keep tables in sales emails short; a long table in a first message reads like an advert.
Questions people ask
How do I convert a CSV file to an HTML table?
Paste the CSV into the box and the HTML table markup appears straight away, with a live preview below. Keep the header option ticked if the first row holds column names. Copy the HTML and paste it into your page, a CMS HTML block or an email template.
Is the generated HTML accessible?
It follows the basics: header cells are th elements with scope="col", the header and body are separated with thead and tbody, and you can add a caption describing the table. For complex tables with merged cells or row headers you would need to add more markup by hand.
Does it add any CSS?
No. The markup is plain so it fits whatever site or template you paste it into. Use the CSS class option to give the table a class name, then style that class in your stylesheet. The preview on this page uses its own light borders only for readability.
Are special characters safe?
Yes. Ampersands, angle brackets and quote marks in your data are escaped as HTML entities, so a value like Kiln & Co or a stray <b> in a cell shows as text and cannot break the page or inject markup.
Where your data goes
Markup is built locally from your CSV, and the preview is drawn in this tab. The data is never uploaded.
Checked against the tool on