Home > Web Front-end > HTML Tutorial > Create title for table in HTML?

Create title for table in HTML?

王林
Release: 2023-09-08 18:17:10
forward
2316 people have browsed it

Create title for table in HTML?

Add a title to the table using the

tag. You can try running the following code to include the table title in HTML -

Example

Here we have added the table title "Indian Cricketers" -

<!DOCTYPE html>
<html>
   <head>
      <style>
         table, th, td {
         border: 1px solid black;
         }
      </style>
   </head>
   <body>
      <h2>Cricketers</h2>
      <table style = "width:100%">
         <caption>Indian Cricketers</caption>
         <th>Name</th>
         <tr>
            <td>Sachin Tendulkar</td>
         </tr>
         <tr>
            <td>Virat Kohli</td>
         </tr>
      </table>
   </body>
</html>
Copy after login

The above is the detailed content of Create title for table in HTML?. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
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