Home | HTML | Asp.Net | HTML Probe | .Net Probe
   
 www.solvingera.com 
  Contact Us |Sitemap
  
   

Table in HTML

  
 Skip Navigation LinksHome>Html Home>HTML Table

HTML tables is built from three basic elements:

Borders: Every basic table must always have exactly four borders that make up a rectangle.

Cells: These are the individual squares (spaces) within the borders of a table.

Cell span: change cell space by combining, or merging, cells.

Tags for table

  • <tr> stands for table row. it is always enclosed within <table>.

  • <td> stands for Table (data) cell. It is always enclosed within <tr>.

  • <th>: The table header element displays text in boldface with a default center alignment.

  • <caption>: This is the table caption element. It is designed to exist anywhere inside the <table> . . .< /table> tags but not inside table rows or cells. This element can only occur once per table.

  • <tbody>: You can group table rows into a table body section with the table body (<tbody>) element.

  • <thead> element must contain at least one table row.

  • <tfoot>The table footer contains information about the table’s columns and must contain at least one table row.

  • <colgroup>: This element creates an explicit column group. You specify the number of columns by using the <span> attribute or by using the <col> element.

  • <span>:You use the span attribute to specify a uniform width for a group of columns.

  • cellspacing: is used to add space between cells (the border width is adjusted).

  • cellpadding: is used to add space inside a cell (within the cell walls).

Example:

<table cellpadding="0" cellspacing="0" frame="border">
 <tr>
  <td colspan="3" align="center" > It is ColSpan=3 </td>
 </tr>
 <tr>
  <td width="65px">it</td>
  <td width="75px">is row</td>
  <td width="85px">2</td>
 </tr>
 <tr>
  <td></td>
  <td>
    <table bgcolor="#99FF99" border="solid" cellpadding="1" cellspacing="1">
    <tr>
      <td width="30px"> hi </td>
      <td width="25px">!</td>
      <td width="40px">hellow</td>
    </tr>
    <tr>
      <td>nested </td>
      <td>table </td>
     <td>is </td>
    </tr>
    <tr>
      <td>here! </td>
      <td></td>
      <td> </td>
    </tr>
    </table>
  </td><td>
  </td>
 </tr>
</table>

Output:


It is ColSpan=3
itis row2
hi!hellow
nestedtableis
here!  
      
  
     
    
   
  
DMCA.com Protection Status
Design & Maintain By solvingera group| solvingera.com © 2013-2014 | all right reserved |Privacy Policy | Back to top