Monday, January 7, 2019

A table with a caption

A table with a caption:-     


<html>
<head>
<style>
table, th, td {
  border: 2px solid black;
  border-collapse: collapse;
}
th, td {
  padding: 5px;
  text-align: left;
}
</style>
</head>
<body>

<h2>Table Caption</h2>
<p>To add a caption to a table, use the caption tag.</p>

<table style="width:100%">
  <caption>Car Price</caption>
  <tr>
      <tr>
    <th>Car</th>
    <th>Price</th>
  </tr>
  <tr>
    <td>Maruti</td>
    <td>$860</td>
  </tr>
  <tr>
    <td>Fortuner</td>
    <td>$1000</td>
  </tr>
</table>

</body>
</html>

OUTPUT:-     




No comments:

Post a Comment

Internal Javascripts

Internal Javascripts :    The script code can be written directly into the HTML document. script code is placed in header of the docume...