What is the function of caption attribute

小老鼠
Release: 2023-11-23 11:54:25
Original
1722 people have browsed it

In HTML, the caption attribute is an attribute used to specify the table title.

By using the caption attribute, you can specify a title for the table, which will be displayed at the top of the table. This title can be any text and can be formatted using CSS styles.

Here is an example of using the caption attribute:

html
<table caption="这是一个表格标题">  
  <tr>  
    <th>姓名</th>  
    <th>年龄</th>  
  </tr>  
  <tr>  
    <td>张三</td>  
    <td>25</td>  
  </tr>  
  <tr>  
    <td>李四</td>  
    <td>30</td>  
  </tr>  
</table>
Copy after login

In the above example, the caption Property specifies a table title that will be displayed at the top of the table. This title can be any text and can be formatted using CSS styles.

The above is the detailed content of What is the function of caption attribute. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template