CBSE Class 10 Computer Applications Question 11 of 81

Images, Links and Tables — Question 2

Back to all questions
2
Question

Question 2

Shagun wants to set different background colours for the individual cells of the table. How can she achieve this?

Answer

We can use the 'bgcolor' attribute of the <TD> element to give different colours to the cells of a table. Consider the following example,

<TABLE>
<TR> 
<TD BGCOLOR = "YELLOW"> Cell 1 </TD> 
<TD BGCOLOR = "PINK"> Cell 2 </TD> 
</TR>
<TR> 
<TD BGCOLOR = "BLUE"> Cell 3 </TD> 
<TD BGCOLOR = "GREEN"> Cell 4 </TD> 
</TR>
</TABLE>