• In HTML Table will be created by using <table>table data goes here..</table> tag.
  • We know that table contains Rows and Columns, those are defined with tr and td.
  • <tr> stands for Table Row which is used to make a Row.
  • <td> stands for Table Data that is used to make a Column.
  • Table heading can be defined by using <th>Name</th>
  • Cellpadding and Cellspacing is used to adjust the white space in table cell.
  • Cellspacing defines the width of the border. cellspacing="0" cellpadding="15"
  • Cellpadding represents the distance between cell borders and the content within.
    <caption> Books Information</caption> tag will serve as a title and show at the top of the table.


Example HTML Table Code:


<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>

<table border="1" cellpadding="15"  cellspacing="0" align="center" width="30%">
<caption><u>Books Information</u></caption>
<!--------Heading starts----------->
<tr style="color:#06F">
     <th>Available BOOKS</th>
<!--------Heading Ends----------->

<!--------1st Row starts----------->
<!--------1st Row Ends----------->

<!--------2nd Row starts----------->
   <td>Oxford Dictionary</td>
<!---------2nd Row Ends----------->
<!--------3rd Row starts----------->
<!--------3rd Row ends----------->



html table programming9