Monday 6 February 2023

HTML - TABLE TAG

 

     HTML Table Tag

 
 

 


===================================================

Use the HTML <table> element to define a table.

Use the HTML <tr> element to define a table row.

Use the HTML <td> element to define a table data.

Use the HTML <th> element to define a table heading.

Use the HTML <caption> element to define a table caption Use the CSS border property to define a border.

Use the CSS border-collapse property to collapse cell borders.

Use the CSS padding property to add padding to cells.

Use the CSS text-align property to align cell text.

====================================================

HTML Table Tags

   Tag                       Description

<table>               Defines a table

<th>                 Defines a header cell in a table

<tr>                  Defines a row in a table

<td>                  Defines a cell in a table

<caption>             Defines a table caption

<colgroup>           Specifies a group of one or more columns in a table for

formatting

<col>                 Specifies column properties for each column within a

                        <colgroup> element

<thead>                Groups the header content in a table

<tbody>                Groups the body content in a table

<tfoot>                  Groups the footer content in a table

====================================================


Table Html Tag 

<!DOCTYPE html>
  <html>
  <head>
  <style>
  table
  { 
  width:100%;
  }
  table, th, td {
  border: 1px solid black;
  border-collapse: collapse;
  }
  table#t01 th 
  {
  background-color:blue;
  color:white;
  }
  </style>
  </head>
  <body>
  <table id="t01">
  <caption> Student Data</caption>
  <tr>
  <th>Sr.No</th>
  <th> Std </th>
  <th> Div </th>
  <th> Total No</th>
  </tr>
  
  <tr>
  <td> 1</td>
  <td> Std - I </td>
  <td> A</td>
  <td> 100 </td>
  </tr>
  
  
  <tr>
  <td> 2</td>
  <td> Std - II </td>
  <td> A</td>
  <td> 110 </td>
  </tr>
  
  
   <tr>
  <td> 3</td>
  <td> Std - III </td>
  <td> A</td>
  <td> 120 </td>
  </tr>
  
  </table>
  </body>
  </html>

  

  Output:-



  
  
  
  
  
  



No comments:

Post a Comment