HTML Table Generator Guide: Build Clean Tables From Rows
Some data belongs in a table. Prices with features, schedules with times, comparison rows with values: when information has rows and columns with meaningful headers, a table presents it more clearly than paragraphs or lists ever will. A table lets the eye compare across a row and down a column, and it gives assistive technology a structure it can announce, so a screen reader user can navigate cell by cell with headers repeated for context.
The HTML Table Generator tool builds a table from rows of data you enter or paste. The structure it produces has three parts. The thead element holds header cells, written with th, that name each column. The tbody element holds the data rows, each a tr containing td cells. An optional caption element names the table as a whole, which helps every reader understand what the table is about before reading its cells. That structure is the difference between a table and a grid of divs that merely looks like one: the browser and assistive technology understand the former, while the latter is just boxes.
Tables also have a scope question that beginners miss. A th cell should declare whether it heads a column or a row, using the scope attribute, so assistive technology announces the right header for each data cell. A column header uses scope col, and a row header, such as a product name at the start of each row, uses scope row. Without scope, a screen reader must guess, and guesses about tables are often wrong in exactly the cases where the data matters most.
A worked example you can follow
Suppose you need a table of three plans with monthly prices: Basic at 10, Standard at 20 and Premium at 35, in dollars. The table has 3 data rows plus 1 header row, totalling 4 rows, and 2 columns, plan and price. The cell count is 4 rows times 2 columns, which equals 8 cells, of which 2 are header cells and 6 are data cells. The average price is 10 plus 20 plus 35, which equals 65, divided by 3, which equals about 21.67 dollars. That average is not part of the table, but computing it checks that the entered values are the intended ones before the table is published.
Now add a row header improvement: make the plan name in each row a th with scope row instead of a td. The cell count stays 8, but the header cell count rises from 2 to 5, since 2 column headers plus 3 row headers equals 5, and data cells fall from 6 to 3. A screen reader user navigating to the price 35 now hears Premium, Price, 35, with both headers announced, instead of hearing a bare number without context. The table looks identical visually, but its meaning for assistive technology is transformed by a small structural change.
Keep tables focused. A table with 12 columns may be complete, but it is hard to read on a narrow screen, where horizontal scrolling hides the row headers. Splitting a wide table, hiding less important columns on small screens, or presenting the data differently for mobile are all legitimate responses. The CSV to JSON Converter tool helps move tabular data between formats, and the Remove HTML Tags tool strips markup when plain text is wanted, and see the HTML Formatter Guide for keeping generated markup readable.
Common mistakes to avoid
The first mistake is using tables for layout, which confuses assistive technology and makes responsive design painful. The second is omitting header cells, leaving a grid of numbers with no labels. The third is omitting scope on row headers, so data cells lose their context. The fourth is building tables with inconsistent column counts, where one row has more cells than the header, which browsers repair unpredictably. The fifth is publishing a table without a caption or surrounding explanation, so readers must infer what the numbers mean.
For background on presenting data clearly, see Choose the Right Chart. Build tables with headers, scope and a caption, check the cell counts, and the data will be readable by everyone, on every screen.
Tables on small screens
Tables meet their hardest test on a narrow phone screen, where a table designed for a desktop monitor cannot fit. Several responses exist, and the right one depends on the data. Horizontal scrolling keeps the table intact but hides columns off-screen, which works when readers compare across a row and can scroll deliberately, but fails when they must constantly scroll back to check a row header. Stacking transforms each row into a card, with each cell labelled by its header, which reads well on phones but loses the column-comparison advantage that made the table valuable. Hiding less important columns on small screens preserves the table shape for the columns that matter most, but it hides data that some readers need.
The choice should follow the reader's task. If the task is finding one row and reading across it, stacking serves well, because the row's data stays together with its labels. If the task is comparing values down a column, such as finding the cheapest price, scrolling preserves that comparison better, since the column stays a column. If the task is scanning for a single value, hiding secondary columns keeps the scan fast. There is no universally correct responsive table, only a table whose small-screen behaviour matches its readers' most common task, and that task should be identified before the table is built, not after complaints arrive.
Data freshness is a second table responsibility that is easy to neglect. A table of prices, dates or specifications becomes wrong over time, and a wrong table is worse than no table, because readers trust its structured appearance. Note the date the data was verified, check it on a schedule, and remove or update tables whose data can no longer be confirmed. A table generator makes building tables easy; it does not make maintaining them automatic, and the maintenance schedule is part of publishing a table, not an afterthought.