HTML | Tags and Attributes [TABLE] [Formatting] [Cell spacing and cell padding ]

Ü Adjust cell spacing and cell padding : The value of CELLSPACING specifies the amount of space between the cells and the value of CELLPADDING specifies the space between the border and the cell data. Use these tags between the <TABLE> tags. We can use them also in <TH> and <TD> tag for results in a particular cell. See the following image to understand, The above figures are the output of the following input,






Input :
<HTML><HEAD><TITLE>TABLE</TITLE></HEAD>
<BODY> Use of cellspacing and cellpadding..<BR>
<TABLE BORDER=3 WIDTH=50% CELLSPACING=15 CELLPADDING=15>
<CAPTION><B><U><FONT SIZE=5>AMERICA</FONT></B></U></CAPTION>
<TR>
<TD BGCOLOR=YELLOW ALIGN=CENTER COLSPAN=2>USA</TD>
</TR>
<TR>
<TD BGCOLOR=RED >New York</TD>
<TD BGCOLOR=GREEN ALIGN=CENTER>New Jersy</TD>
</TR>
</TABLE></BODY></HTML>
Output: 







Author: Tanmay Chakrabarty

Tanmay Chakrabarty is a former CSE student, currently working as a Senior Software Engineer with 5+ years of experience in the field of Web Application development in PHP+MySQL platform with strong skills in Javascript, JQuery, JQuery UI and CSS. He tries to write notes every week but fails due to heavy loads of duty.

Recommended Recommends

Comments

Contact Us