Home>Article>Web Front-end> How to use caption tag
Thecaption tag is used to add a title to an HTML table. The caption must appear immediately after the table in the HTML document. It can be positioned intuitively at the bottom of the table using CSS. Let’s take a look. Specific usage of caption tag.
The caption element defines the table title, but only one title can be defined for each table. Usually this title will be centered above the table. (Reference address:HTML table)
Let’s look at a specific example
The code is as follows
最喜欢的颜色 名字 喜欢的颜色 Tom 蓝色 Jerry 红色 Marry 粉色 Cindy 黄色
The effect is as follows: The title is in the middle of the table.
This article ends here. For more exciting content about the front-end, you can pay attention to the relevant column tutorials on the PHP Chinese website! ! !
The above is the detailed content of How to use caption tag. For more information, please follow other related articles on the PHP Chinese website!