Cell padding, Tag Inside Tble

Previous page

Cell padding (control the white space between cell content and the borders
<html>
<body>
<h1>Without cellpadding:</h1>
<table border="1">
<tr>
  <td>First</td>
  <td>Row</td>
</tr>  
<tr>
  <td>Second</td>
  <td>Row</td>
</tr>
</table>

<h2>With cellpadding:</h2>
<table border="2"
cellpadding="20">
<tr>
  <td>First</td>
  <td>Row</td>
</tr>  
<tr>
  <td>Second</td>
  <td>Row</td>
</tr>
</table>
</body>
</html>

Without cellpadding:

First Row
Second Row

With cellpadding:

First Row
Second Row

 
 2) Tag Inside a table using ordered List
<html>
<body>
<table border="2">
<tr>
  <td>
   <p>This is a paragraph</p>
   <p>I am sahil</p>
  </td>
  <td>This cell contains a table:
   <table border="2">
   <tr>
     <td>1</td>
     <td>2</td>
   </tr>
   <tr>
     <td>3</td>
     <td>4</td>
   </tr>
   </table>
  </td>
</tr>
<tr>
  <td>This cell contains a ordered list with lower letters
   <ol type ="a" >
    <li>Potato</li>
    <li>Tomato</li>
    <li>Carrot</li>
   </ol>
  </td>
  <td>Sahil</td>
</tr>
</table>
</body>
</html>


This is a paragraph
I am sahil
This cell contains a table:
1 2
3 4
This cell contains a ordered list with lower letters
  1. Potato
  2. Tomato
  3. Carrot
Sahil

No comments:

Post a Comment