caption-side property in CSS

caption-side property in CSS

 
It specifies the placement of the table caption. It has the Following Three Values: Top, Bottom, Inherit. Top is used to put the caption in the Top. Bottom is used to put the caption in the Bottom. and in Inherit, we can specify the value of it.
 
Here we take an Example of Top:
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"   
  2. <html>  
  3.   
  4. <head>  
  5.    <style type="text/css">  
  6.    caption   
  7.    {  
  8.       caption-side: top;  
  9.    }  
  10.    </style>  
  11. </head>  
  12.   
  13. <body>  
  14.    <table border="1">  
  15.       <caption>Student's Data</caption>  
  16.       <tr>  
  17.          <th>Name</th>  
  18.          <th>Place</th>  
  19.          <th>Country</th>  
  20.       </tr>  
  21.       <tr>  
  22.          <td>Mahak</td>  
  23.          <td>Jaipur</td>  
  24.          <td>India</td>  
  25.       </tr>  
  26.       <tr>  
  27.          <td>Pihu</td>  
  28.          <td>Gurgaon</td>  
  29.          <td>India</td>  
  30.       </tr>  
  31.    </table>  
  32. </body>  
  33.   
  34. </html> 
Output:
 
1.png
 
Note: IE supports this property only when we specify !DOCTYPE in our program.
Next Recommended Reading Clip property in CSS