Computer Applications
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>
Related Questions
Create a table having four header rows with yellow background colour, four table body rows having light orange colour, and two footer rows having light green colour. Add table contents on your own.
Raveena wants to insert an image on her web page and align it in the center. She has written the following code to center-align the image, but the desired result is not displayed. Can you tell her what is wrong with her code?
<IMG Src= "SAVETIGER.GIF" Align= "Center">
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?
Ayush has to display the sequence of events of the upcoming Annual Sports Day on the school website. Help Ayush in writing the HTML code to generate the following output.