The width attribute of <td> is deprecated in HTML 5.

Use CSS. e.g.

 <td style="width:100px">

in detail, like this:

<table >
  <tr>
    <th>Month</th>
    <th>Savings</th>
  </tr>
  <tr>
    <td style="width:70%">January</td>
    <td style="width:30%">$100</td>
  </tr>
  <tr>
    <td>February</td>
    <td>$80</td>
  </tr>
</table>
Answer from Ravindra Bagale on Stack Overflow
🌐
GeeksforGeeks
geeksforgeeks.org › html › html-td-width-attribute
HTML &lt;td&gt; width Attribute - GeeksforGeeks
The HTML <td> width attribute was traditionally used to specify the width of a table cell. If this attribute is not set, the cell automatically adjusts its width based on the content it contains.
Published   July 11, 2025
🌐
W3Schools
w3schools.com › html › html_table_sizes.asp
HTML Table Sizes
To set the width of a table, add the style attribute to the <table> element: ... <table style="width:100%"> <tr> <th>Firstname</th> <th>Lastname</th> <th>Age</th> </tr> <tr> <td>Jill</td> <td>Smith</td> <td>50</td> </tr> <tr> <td>Eve</td> ...
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › HTML › Reference › Elements › td
<td> HTML table data cell element - MDN Web Docs
5 days ago - Only use this attribute with the <th> element to define the row or column for which it is a header, as this attribute is deprecated for the <td> element. ... Specifies the vertical alignment of the data cell. The possible enumerated values are baseline, bottom, middle, and top. Use the vertical-align CSS property instead, as this attribute is deprecated. ... Defines a recommended data cell width.
🌐
HTML.com
html.com › attributes › td-width
Stop Using To Set Table Width In HTML: Here's Why »
January 24, 2020 - The width attribute, now deprecated, was once the correct way to adjust the width of a table’s columns. By default, a browser will adjust table columns to fit the contents of the table. However, if you want to control the width of each column, you can do so by adjusting the width of each <td> or <th> of a single row.
🌐
GeeksforGeeks
geeksforgeeks.org › html › how-to-set-fixed-width-for-td-in-a-table
How to set fixed width for &lt;td&gt; in a table ? - GeeksforGeeks
Using CSS: The Cascading Style Sheet(CSS) is widely used to decorate the web pages which are of vast sizes. By using CSS, the styling of HTML elements is easy to modify. To fix the width of td tag the nth-child CSS is used to set the property of specific columns(determined by the value of n) in each row of the table.
Published   July 15, 2025
🌐
Ironspider
ironspider.ca › tables › tablecells3.htm
Table Cells - Width and Height
width="pixels or percentage" ~ Using the width attribute in your <td> tags, you can explicitly set the width of your table data cells. This will have the effect of setting not only the width of that particular cell but will also set the width of the entire column in which that cell resides.
🌐
W3Schools
www-db.deis.unibo.it › courses › TW › DOCS › w3schools › tags › att_td_width.asp.html
HTML td width Attribute
<table> <tr> <th>Month</th> <th>Savings</th> </tr> <tr> <td width="70%">January</td> <td width="30%">$100</td> </tr> <tr> <td>February</td> <td>$80</td> </tr> </table> Try it Yourself »
Find elsewhere
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › CSS › Reference › Properties › table-layout
table-layout CSS property - MDN Web Docs - Mozilla
1 week ago - table { border: 1px solid #113399; } th, td { border: 2px solid #aa1199; padding: 0.25rem 0.5rem; } ... /* Keyword values */ table-layout: auto; table-layout: fixed; /* Global values */ table-layout: inherit; table-layout: initial; table-layout: revert; table-layout: revert-layer; table-layout: unset; ... The automatic table layout algorithm is used. The widths of the table and its cells are adjusted to fit the content.
🌐
W3Schools
w3schools.com › tags › tag_td.asp
HTML td tag
The <td> tag also supports the Event Attributes in HTML. ... <table style="width:100%"> <tr> <th>Month</th> <th>Savings</th> </tr> <tr> <td>January</td> <td style="text-align:right">$100</td> </tr> <tr> <td>February</td> <td style="text-align:right">$80</td> </tr> </table> Try it Yourself »
🌐
DhiWise
dhiwise.com › post › html-table-width-best-practices-for-a-modern-web-design
How to Set HTML Table Width For Responsive UI
June 17, 2025 - To control the table column width, you can apply the width attribute or the style attribute to individual table cells (td or th elements).
🌐
GeeksforGeeks
geeksforgeeks.org › html › how-to-auto-adjust-table-td-width-from-the-content-in-html
How to Auto Adjust Table td Width from the Content in HTML? - GeeksforGeeks
July 26, 2025 - Example: The below example uses width: fit-content to Auto Adjust Table td Width from the Content in HTML.
🌐
TEKNKL :: Blog
blog.teknkl.com › width-height-html-attributes-ignore-non-digits-per-standard
Yes, ˂td width="100px"˃ is valid HTML (still looks wrong, though)
September 26, 2021 - So they’re used to setting the ancient width and height HTML attributes on an element (not to be confused with width and height CSS properties). For example, to give a table cell a certain pixel width: <td width="10"> Where a unit-less numeric ...
🌐
Scaler
scaler.com › home › topics › how to set html table width?
How to Set HTML Table Width? - Scaler Topics
May 4, 2023 - To customize the width of an entire table, the width attribute is used for the <table> element, whereas, for individual cells, the attribute is used for the <td> element. The values that the width attribute supports are as follows: pixels: It ...
🌐
Coderanch
coderanch.com › t › 113006 › languages › width-HTML-table-cell
width of HTML table cell (HTML Pages with CSS and JavaScript forum at Coderanch)
<table width="779"> <tr> <td width="152"> <!--some code --> </td> <td width="621"> <table width="100%"> <tr width="100%"> <!--some code --> </tr> <tr width="100%"> <td width="100%"> <table width ="100"> <tr> <td width="10"> col1</td> <td width="100"> col2</td> <td width="74"> col3</td> <td width="100"> col4</td> <td width="97">col5 </td> <%if(condition){%> <td width="159">col6 </td> <%}%> </tr> <tr> <td width="10">value1</td> <td width="100">value2</td> <td width="74">value3</td> <td width="100">value4</td> <td width="97">value5 </td> <%if(condition) {%> <td width="159">value6 </td> <%}%> </tr> </table> </td> </tr> </table> </td> </tr> </table> ... Boost this thread! ... Help me to have a sortable table in my html profile!
🌐
Tutorial Republic
tutorialrepublic.com › faq › how-to-set-fixed-width-for-td-regardless-of-its-content.php
How to Set Fixed Width for <td> Regardless of its Content
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Set Fixed Width for Table Columns</title> <style> table { width: 300px; } th, td { width: 50%; } table.fixed { table-layout: fixed; } table, th, td{ border: 1px solid black; ...
🌐
TutorialsPoint
tutorialspoint.com › article › how-to-set-fixed-width-for-td-in-a-table
How to set fixed width for td in a table ?
March 16, 2026 - To set cell width we can use HTML width attribute with specified values in pixels inside the <td> tag.