KnowledgeBoat Logo

Computer Applications

Shivam has been given an assignment by her class teacher to design a table in such a way that the amount of space between its cell borders and cell data is 5 pixels and distance between any two cells is 3 pixels. Which attributes can she use to accomplish the task?

HTML Advanced Features

CBSE

6 Likes

Answer

Shivam can use Cellspacing attribute of <TABLE> element to set the distance between any two cells and Cellpadding attribute of <TABLE> element to set the amount of space between its cell borders and cell data. Consider the following example,

<TABLE BORDER = "1" CELLSPACING = "3" CELLPADDING = "5">
<TR> 
<TD> Fruits </TD> 
<TD> Vegetables </TD> 
</TR>
<TR> 
<TD> Mango</TD> 
<TD> Potato</TD> 
<TR>
<TD>Guava </TD>
<TD>Aubergine </TD>
</TR>
<TR>
<TD>Banana </TD>
<TD>Cauliflower </TD>
</TR>
</TR>
</TABLE>

Answered By

4 Likes


Related Questions