Create caption for a table in HTML?

Use the <caption> tag to add a caption to a table. You can try to run the following code to include a table caption in HTML −


Here, we have added a table caption “Indian Cricketers” −

<!DOCTYPE html>
         table, th, td {
         border: 1px solid black;
      <table style = "width:100%">
         <caption>Indian Cricketers</caption>
            <td>Sachin Tendulkar</td>
            <td>Virat Kohli</td>