width
Usually controlled with CSS, not HTML attributes.
Learn Table Sizes with practical examples for tables, lists, structured data relationships, accessibility, SEO and live practice.
HTML data structures
A table can look perfect on a large monitor and break badly on a phone. Sizing is where table HTML meets responsive CSS.
Modern projects usually avoid width and height attributes on table cells. Use CSS for layout decisions and keep HTML focused on data.
The goal is not to force every table into every viewport. Sometimes the best responsive table is a horizontally scrollable table with clear column widths.
Usually controlled with CSS, not HTML attributes.
Can make columns predictable when data is consistent.
Keeps dense data readable inside a scroll wrapper.
Controls whether cell content wraps or stays on one line.
Syntax and structure
A table wrapper can allow horizontal scroll while the table keeps a sensible minimum width.
<div class="table-scroll">
<table class="data-table">
<caption>Exam planning</caption>
<tr><th scope="col">Student</th><th scope="col">Date</th><th scope="col">Status</th></tr>
<tr><td>Sam</td><td>12 June</td><td>Ready</td></tr>
</table>
</div>
<style>
.table-scroll { overflow-x: auto; }
.data-table { min-width: 640px; }
</style>
<table width="1200">
<tr>
<td width="400">Student</td>
<td width="400">Date</td>
<td width="400">Status</td>
</tr>
</table>
Rules that matter
Tables and lists are small elements with big structural value. They help users scan, compare, follow steps and understand how pieces of information belong together.
Dense data often needs horizontal scroll or a different summary view.
Column width, min-width and wrapping belong in CSS.
table-layout: fixed can prevent columns from jumping around.
Do not squeeze labels until they become unreadable.
Short demo values rarely reveal sizing problems.
If a table has buttons, make sure they remain usable on mobile.
Production thinking
This matters because data tables fail quietly. The markup can be valid while the user still cannot read or compare the information.
Horizontal scrolling should be obvious and keyboard accessible. Do not hide important columns without another way to access them.
Use table wrappers, sticky headers or simplified card views for dense operational tables. Choose based on the task, not only on viewport width.
Readable tables help users compare information. Hidden or broken table content can reduce the usefulness of a page.
Live code lab
Edit the HTML or CSS, then use Run to refresh the preview. The preview is isolated, so links and forms stay inside this practice area.
Mini assignment
Practice assignment
Try it yourself
Self-check
Do not only read this page. Answer these questions out loud or write the answers in your own notes. If one answer feels vague, revisit the examples before moving on.