Computer Applications
Shagun wants to set different background colours for the individual cells of the table. How can she achieve this?
HTML Advanced Features
14 Likes
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>
Answered By
12 Likes
Related Questions
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">
Consider the web page given below and answer the following questions:
- Mention the tags used to create a table pointed by the letter A.
- Which property of
<IMG>
tag is used to wrap the text around the image? - Name the tag and its attributes to set the alignment of text pointed by the letters B and D.
- Name the tag used to create the links pointed by the letter C.
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.