"; 2. Use the style attribute in the td tag and add "width: width value;" style."/> "; 2. Use the style attribute in the td tag and add "width: width value;" style.">

Home>Article>Web Front-end> How to set the width of html td

How to set the width of html td

青灯夜游
青灯夜游 Original
2021-05-14 17:01:20 22058browse

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.

How to set the width of html td

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:

How to set the width of html td

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:

How to set the width of html td

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn