Clean, safe HTML tables from any CSV
Hand-converting CSV to HTML is tedious and, worse, dangerous when done naively: a cell containing <, & or a pasted <script> tag will break your markup — or execute — the moment it lands in a page. This converter HTML-escapes every cell (&, <, >, "), so the output is safe to drop into any document regardless of what the spreadsheet contained.
With the header checkbox on, the first row becomes <th> cells inside a semantic <thead>, with data rows in <tbody> — better for screen readers, sticky headers and print. The output is consistently indented, and the delimiter (comma, semicolon, tab, pipe) is detected automatically with a manual override. Ragged rows are padded with empty cells so every row has the same column count.
Styling the output
Set a class name in the options and hang your CSS off it. A minimal starting point:
.data-table { border-collapse: collapse; width: 100%; }
.data-table th, .data-table td { border: 1px solid #d7dce1; padding: 8px 10px; text-align: left; }
.data-table th { background: #f4f6f8; }The optional <caption> renders above the table and doubles as its accessible name.
When Markdown is the better target
If the table is headed for a README, pull request or wiki, raw HTML is usually the wrong format — the CSV to Markdown Table converter produces GFM pipe tables instead. And if you only need to escape a snippet of text rather than build a table, the HTML Entity Encoder does exactly that.