You can set the width of a table column using the CSS width property of the col element. The width value is most commonly specified in pixels (width: 200px;), or as a percentage of the width of the parent element (width: 50%;). Example with inline style attribute:

<table style="width: 100%">
    <colgroup>
       <col span="1" style="width: 15%;">
       <col span="1" style="width: 70%;">
       <col span="1" style="width: 15%;">
    </colgroup>
    
    
    
    <!-- Put <thead>, <tbody>, and <tr>'s here! -->
    <tbody>
        <tr>
            <td style="background-color: #777">15%</td>
            <td style="background-color: #aaa">70%</td>
            <td style="background-color: #777">15%</td>
        </tr>
    </tbody>
</table>

Answer from Gordon Gustafson on Stack Overflow
๐ŸŒ
W3Schools
w3schools.com โ€บ html โ€บ html_table_sizes.asp
HTML Table Sizes
<table style="width:100%"> <tr> ... case is the <body> element. To set the size of a specific column, add the style attribute on a <th> or <td> element:...
๐ŸŒ
SitePoint
sitepoint.com โ€บ html & css
Best way to set Column Widths in Table? - HTML & CSS - SitePoint Forums | Web Development & Design Community
September 29, 2011 - What is the best way to set Column Widths in a Table using CSS? Can I just set widths on the <th> in my Header Row and then the <td> in the regular rows below will follow suite? Maybe like thisโ€ฆ <thead> <tr id="โ€ฆ
๐ŸŒ
HowTech
howtech.tv โ€บ home โ€บ how to set html table width and height
How to Set HTML Table Width and Height - HowTech
May 21, 2013 - It is used from being an organized data displayer, to being a complete web site layout. In this tutorial we will learn how to set HTML table width and height. Step # 1 โ€“ The width The width of a table can easily be set with the width attribute of the <table> element.
๐ŸŒ
MDN Web Docs
developer.mozilla.org โ€บ en-US โ€บ docs โ€บ Web โ€บ HTML โ€บ Reference โ€บ Elements โ€บ col
<col>: The Table Column element - HTML | MDN
Set a to zero and b to the position of the column in the table, e.g., td:nth-of-type(2) { vertical-align: middle; } to center the second column cells vertically. If the table does use a colspan attribute, the effect can be achieved by combining adequate CSS attribute selectors like [colspan=n], though this is not trivial. ... Specifies a default width for each column.
๐ŸŒ
TutorialsPoint
tutorialspoint.com โ€บ article โ€บ how-to-set-table-width-in-html
How to set table width in HTML?
March 16, 2026 - <!DOCTYPE html> <html> <head> ... Arial, sans-serif; padding: 10px;"> <h2>Cricket Players (Full Width)</h2> <table style="width: 100%"> <tr> <th>S.No</th> <th>Name</th> <th>Age</th> <th>Country</th> </tr> <tr> <td>1</td> <td>Babar ...
๐ŸŒ
CodePen
codepen.io โ€บ danichk โ€บ pen โ€บ ZpeQZq
Taming table column widths
/** * Taming table column widths */ body { background: #ddd } section { width: 500px; margin: 2em; background: white; } table { border-collapse: collapse; margin-bottom: 1em; width: 100%; } section + section table { table-layout: fixed } td ...
Find elsewhere
๐ŸŒ
identity design
blog.identitydesign.us โ€บ home โ€บ css: a simple way to set the table column width
CSS: A Simple Way to Set the Table Column Width - identity design
December 18, 2015 - table tr td { padding:20px } table td:nth-child(1) { width:35%; } table td:nth-child(2) { width:15%; } table td:nth-child(3) { width:5%; } table td:nth-child(4) { width:35%; } table td:nth-child(5) { width:10%; } Copy the code below and paste ...
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ html โ€บ how-to-fix-the-width-of-columns-in-the-table
How to fix the width of columns in the table ? - GeeksforGeeks
September 9, 2024 - If the fixed width is insufficient, the first column may overflow and behave like the others. ... <!DOCTYPE html> <html> <head> <style> table { margin-left: auto; margin-right: auto; font-size: 20px; height: 100%; table-layout: fixed; } td { border: 1px solid black; text-align: center; padding: 10px; } tr:nth-child(even) { background-color: #00cf45; } h1 { color: green; } </style> </head> <body> <center> <h1>GeeksforGeeks</h1> <h2> To fix the width of columns in the table </h2> <table> <tr style="color:white; background-color:black;"> <td width="100px">Col1</td> <td>Col2</td> <td>Col3</td> </t
๐ŸŒ
Tailwind CSS
tailwindcss.com โ€บ docs โ€บ width
width - Sizing - Tailwind CSS
Use w-full or w-<fraction> utilities like w-1/2 and w-2/5 to give an element a percentage-based width:
๐ŸŒ
Symphony
support.symphony.com โ€บ hc โ€บ en-us โ€บ articles โ€บ 360016442352-Amend-the-column-width-of-an-HTML-table
Amend the column width of an HTML table โ€“ Symphony Help Center
<messageML><card accent='tempo-bg-color--blue'> <header>Example Heading</header> <body>Example:<br/><div><table style='border-collapse:collapse;table-layout:auto;width:100%'><thead> <tr><th>Key</th><th>Description</th></tr> </thead> <tr><td style='width:10%'>1</td><td>Analyst Meeting 1-1</td></tr> <tr><td style='width:10%'>2</td><td>Analyst Meeting 2-1</td></tr> <tr><td style='width:10%'>3</td><td>Analyst Meeting Group</td></tr> <tr><td style='width:10%'>4</td><td>Bespoke Work</td></tr> <tr><td style='width:10%'>5</td><td>Chat/Email</td></tr> <tr><td style='width:10%'>6</td><td>Corporate Acces
๐ŸŒ
SitePoint
sitepoint.com โ€บ html & css
Set a table columns width - HTML & CSS - SitePoint Forums | Web Development & Design Community
March 9, 2012 - Hi, I tried to do it by adjusting the <td> width: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Sample Page</title> <style type="text/css"> โ€ฆ
๐ŸŒ
Silverfin
community.silverfin.com โ€บ templates
Table columns in HTML are changing width despite column width being set - Templates - Silverfin
January 21, 2022 - Hello, I am building a table in HTML. And you can see how the table looks below. With all of the column headers being equal width. However, in the exports, the columns are readjusting their width. They seem to be auto-fitting whatever wording is in the column.
๐ŸŒ
W3Schools
w3schools.com โ€บ html โ€บ html_table_headers.asp
HTML Table Headers
HTML tables can have headers for each column or row, or for many columns/rows.
๐ŸŒ
SitePoint
sitepoint.com โ€บ html hub โ€บ table sizes
HTML Table Sizes | SitePoint โ€” SitePoint
Learn how to adjust HTML table sizes, control column and row dimensions, and create responsive layouts. Explore examples for fixed and flexible table designs.
๐ŸŒ
W3Schools
w3schools.com โ€บ css โ€บ css_table_size.asp
CSS Table Size (Width and Height)
The CSS width property is used to set the width of a table. ... The CSS height property is used to set the height of a table. ... If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail: ...
๐ŸŒ
CSS-Tricks
css-tricks.com โ€บ almanac โ€บ properties โ€บ t โ€บ table-layout
table-layout | CSS-Tricks
April 25, 2025 - In the following demo, the table has a element whose first element has a width of 400px. Notice in this case, toggling table-layout: fixed has no effect. This happens because the default layout algorithm is essentially saying โ€œmake the first column 400px wide, and distribute the remaining columns based on their contentโ€. Since the other three columns have the same content as each other, there will be no change.
๐ŸŒ
MDN Web Docs
developer.mozilla.org โ€บ en-US โ€บ docs โ€บ Web โ€บ CSS โ€บ Reference โ€บ Properties โ€บ table-layout
table-layout CSS property - CSS | MDN
Otherwise, the column gets the width from the shared remaining horizontal space. With this algorithm the entire table can be rendered once the first table row has been downloaded and analyzed. This can speed up rendering time over the "automatic" layout method, but subsequent cell content might not fit in the column widths provided.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ html โ€บ how-to-set-table-cell-width-height-in-html
How to Set Table Cell Width & Height in HTML ? - GeeksforGeeks
July 23, 2025 - Example: In the below example we are using inline styling to set table cell width and height. ... <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Table Cell Width and Height</title> </head> <body> <h1 style="color: green;">GeeksForGeeks</h1> <h3> Set width and height of table cell using Inline Styling </h3> <table border="1"> <tr> <th>col 1</th> <th>col 2</th> </tr> <tr> <td style="width: 100px; height: 50px;"> Cell 1 with 100px width </td> <td style="width: 200px; height: 50px;"> Cell 2 with 200px width </td> </tr> </table> </body> </html>
๐ŸŒ
Ant Design
ant.design โ€บ components โ€บ table
Table - Ant Design
Table column title supports colSpan that set in column. Table cell supports colSpan and rowSpan that set in onCell return object. When each of them is set to 0, the cell will not be rendered. ... Display tree structure data in Table when there is field key children in dataSource, try to customize childrenColumnName property to avoid tree table structure. You can control the indent width by setting indentSize.