📊

HTML Table Generator

Paste CSV data, style it with header, stripe and border toggles, preview live and copy the HTML table code.

5 rows × 4 columns
NameRoleCityScore
AyeshaDesignerLahore92
BilalDeveloperKarachi88
ChenManagerBeijing95
DanaAnalystDubai81
<table class="wf-table striped bordered">
  <thead>
    <tr><th>Name</th><th>Role</th><th>City</th><th>Score</th></tr>
  </thead>
  <tbody>
    <tr><td>Ayesha</td><td>Designer</td><td>Lahore</td><td>92</td></tr>
    <tr><td>Bilal</td><td>Developer</td><td>Karachi</td><td>88</td></tr>
    <tr><td>Chen</td><td>Manager</td><td>Beijing</td><td>95</td></tr>
    <tr><td>Dana</td><td>Analyst</td><td>Dubai</td><td>81</td></tr>
  </tbody>
</table>

<style>
.wf-table { border-collapse: collapse; width: 100%; font-family: sans-serif; }
.wf-table th, .wf-table td { padding: 8px 12px; text-align: left; }
.wf-table th, .wf-table td { border: 1px solid #cbd5e1; }
.wf-table tbody tr:nth-child(even) { background: #f1f5f9; }
.wf-table thead th { background: #e2e8f0; }
</style>

Frequently Asked Questions

How do I format my data?

One row per line with commas between cells — the same CSV format spreadsheets export. Rows with fewer cells are padded automatically, and cell text is safely escaped, so characters like < and & cannot break the table.

Does the output include styling?

Yes, when stripes or borders are on, a small <style> block is included with the HTML so the table looks right when pasted as-is. If you already have your own CSS, turn both toggles off and you will get clean semantic markup with a wf-table class only.

Should I use a table for layout?

No — HTML tables are for tabular data (prices, schedules, comparisons). Using them for page layout hurts accessibility and responsiveness. Screen readers announce tables cell by cell, which is exactly right for data.

Can I edit a cell after generating?

The fastest way is to edit the CSV text — the preview and code update instantly as you type. For one-off tweaks you can also edit the generated HTML directly before pasting it into your page.

Related Tools