uses of cellpadding and cellspacing




Asked on February 16, 2015
I want to create a table in HTML using Dreamweaver its added  cellpadding and cellspacing, anyone tell me the use of this attributes ?
my code is here

<table width="770" border="1" cellpadding="0" cellspacing="0">
  <caption>
    Student Name
  </caption>
  <tr>
    <td>&nbsp;</td>
    <td colspan="4" align="center">Ist Student </td>
    <td colspan="5" align="center">2nd Student </td>
    </tr>
  <tr>
    <td width="70">1</td>
    <td width="70">a</td>
    <td width="70">b</td>
    <td width="70">c</td>
    <td width="70">d</td>
    <td width="70">e</td>
    <td width="70">f</td>
    <td width="70">g</td>
    <td width="70">i</td>
    <td width="76">j</td>
  </tr>
  <tr>
    <td width="70">2</td>
    <td width="70">a</td>
    <td width="70">b</td>
    <td width="70">c</td>
    <td width="70">d</td>
    <td width="70">e</td>
    <td width="70">f</td>
    <td width="70">g</td>
    <td width="70">i</td>
    <td width="76">j</td>
  </tr>
  <tr>
    <td width="70">3</td>
    <td width="70">a</td>
    <td width="70">b</td>
    <td width="70">c</td>
    <td width="70">d</td>
    <td width="70">e</td>
    <td width="70">f</td>
    <td width="70">g</td>
    <td width="70">i</td>
    <td width="76">j</td>
  </tr>
  <tr>
    <td width="70">4</td>
    <td width="70">a</td>
    <td width="70">b</td>
    <td width="70">c</td>
    <td width="70">d</td>
    <td width="70">e</td>
    <td width="70">f</td>
    <td width="70">g</td>
    <td width="70">i</td>
    <td width="76">j</td>
  </tr>
</table>



Replied on February 20, 2015
Cellpadding and Cellspacing are very important attributes of html table element.

Cellpadding: Distance in pixel between cell content and cell border. 
Cellspacing : Distance in pixel between two adjoining cells.



Write Answer










©2024 concretepage.com | Privacy Policy | Contact Us