Home>Article>Web Front-end> How to set the width of html td
html How to set the width of td: 1. Directly use the width attribute of the td tag, the syntax format is "
"; 2. In the td tag Use the style attribute to add the "width: width value;" style.
The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.
1. Directly use the width attribute of the td tag
The width attribute specifies the width of the table cell.
Generally, the space occupied by a cell is the space required to display its content. The width attribute is used to set a predefined width for the cell.
Example:
商品 | 价格 |
T恤 | ¥100 |
牛仔褂 | ¥250 |
牛仔库 | ¥150 |
Rendering:
2. Use the style attribute to add " width: width value; "Style
The style attribute specifies the inline style of the element.
Example:
商品 | 价格 |
T恤 | ¥100 |
牛仔褂 | ¥250 |
牛仔库 | ¥150 |
Rendering:
Recommended tutorial: "html video tutorial"
The above is the detailed content of How to set the width of html td. For more information, please follow other related articles on the PHP Chinese website!