16. Write the HTML code to show the use of the RULES attribute.
Answer: Code for showing how to use the RULES attribute is
<!DOCTTYPE html>
<HTML>
<HEAD>
<TITLE> Creating Table in HTML </TITLE>
</HEAD>
<BODY>
<p> rules = "all"</p>
<TABLE BORDER="1" BORDERCOLOR="black" RULES = "all">
<TR>
<TD> C-1</TD> <TD> C-2 </TD> <TD> C-3 </TD>
</TR>
<TR>
<TD> A </TD> <TD> B </TD> <TD> C</TD>
</TR>
</TABLE>
<p>RULES = "groups"</p>
<p>RULES = "cols"</p>
<TABLE BORDER="1" BORDERCOLOR="black" RULES = "cols">
<TR>
<TD> C-1</TD> <TD> C-2 </TD> <TD> C-3 </TD>
</TR>
<TR>
<TD> A </TD> <TD> B </TD> <TD> C</TD>
</TR>
</TABLE>
<p>RULES = "rows"</p>
<TABLE BORDER="1" BORDERCOLOR="black" RULES = "rows">
<TR>
<TD> C-1</TD> <TD> C-2 </TD> <TD> C-3 </TD>
</TR>
<TR>
<TD> A </TD> <TD> B </TD> <TD> C</TD>
</TR>
</TABLE>
</BODY>
</HTML>
17. What is the difference between FRAME & RULES attributes of TABLE in HTML?
Answer: The FRAME attribute of the <TABLE> tag is used to specify the outside border while the RULES attribute of the <TABLE> tag is used to specify the inside cell border.
18. How to control the cell spacing inside the TABLE in HTML?
Answer: In HTML, Cell spacing can be controlled by the CELLSPACING & the CELLPADDING attribute of the <TABLE> tag.
19. What is the CELLSPACING attribute in the <TABLE> tag?
Answer: In <TABLE>, the CELLSPACING attribute gives the amount of space between cells.
20. What is the CELLPADDING attribute in HTML?
Answer: In HTML <TABLE>, the CELLPADDING gives the amount of space or padding between the cell border and the cell contents.
21. Differentiate between CELLSPACING and CELLPADDING attributes in HTML?
Answer: CELLSPACING is used to specify the amount of space between two cell’s borders, while CELLPADDING is used to specify the amount of space or padding between the cell border and the cell contents.
22. Write an HTML code to explain the uses of CELLSPACING and CELLPADDING attributes?
Answer: Code to explain CELLSPACING and CELLPADDING-
<!DOCTTYPE html>
<HTML>
<HEAD>
<TITLE> Creating Table in HTML </TITLE>
</HEAD>
<BODY>
<CENTER>
<H2>www.mycstutorial.in</H2>
<h3> Table without cellspacing and cellpadding</h3>
<TABLE BORDER="3" BORDERCOLOR="blue">
<TR>
<TD> Web Site Name </TD> <TD> Web URL </TD> <TD> Mobile Number </TD>
</TR>
<TR>
<TD> mycstutorial </TD> <TD> www.mycstutorial.in </TD> <TD> 8221909045 </TD>
</TR>
</TABLE>
<h3> Table with cellspacing = 10 </h3>
<TABLE BORDER="3" BORDERCOLOR="red" CELLSPACING = "10">
<TR>
<TD> Web Site Name </TD> <TD> Web URL </TD> <TD> Mobile Number </TD>
</TR>
<TR>
<TD> mycstutorial </TD> <TD> www.mycstutorial.in </TD> <TD> 8221909045 </TD>
</TR>
</TABLE>
<h3> Table with cellpadding = 20 </h3>
<TABLE BORDER="3" BORDERCOLOR="magenta" CELLPADDING = "20">
<TR>
<TD> Web Site Name </TD> <TD> Web URL </TD> <TD> Mobile Number </TD>
</TR>
<TR>
<TD> mycstutorial </TD> <TD> www.mycstutorial.in </TD> <TD> 8221909045 </TD>
</TR>
</TABLE>
</CENTER>
</BODY>
</HTML>

22. Which attribute of the <TABLE> tag is used to change the alignment of the table?
Answer: ALIGN attribute. The ALIGN attribute of TABLE tag is align the complete table. It can have values left, right and center.
<TABLE ALIGN = “LEFT”> … </TABLE>
<TABLE ALIGN = “CENTER”> … </TABLE>
<TABLE ALIGN = “RIGHT”> … </TABLE>
23. Give example of ALIGN attribute of the <TABLE>?
Answer: HTML code to align the table-
<!DOCTTYPE html>
<HTML>
<HEAD>
<TITLE> Creating Table in HTML </TITLE>
</HEAD>
<BODY>
<H2 ALIGN="CENTER">www.mycstutorial.in</H2>
<HR>
<p>
<h2> Left Align Table</h1>
<TABLE BORDER="3" ALIGN = "LEFT">
<TR>
<TD> Web Site Name </TD> <TD> Web URL </TD> <TD> Mobile Number </TD>
</TR>
<TR>
<TD> mycstutorial </TD> <TD> www.mycstutorial.in </TD> <TD> 8221909045 </TD>
</TR>
</TABLE>
</p>
<br> <br>
<p>
<h2> Center Align Table</h1>
<TABLE BORDER="3" ALIGN = "CENTER">
<TR>
<TD> Web Site Name </TD> <TD> Web URL </TD> <TD> Mobile Number </TD>
</TR>
<TR>
<TD> mycstutorial </TD> <TD> www.mycstutorial.in </TD> <TD> 8221909045 </TD>
</TR>
</TABLE>
</p>
<p>
<h2 align="right"> Right Align Table</h1>
<TABLE BORDER="3" ALIGN = "RIGHT">
<TR>
<TD> Web Site Name </TD> <TD> Web URL </TD> <TD> Mobile Number </TD>
</TR>
<TR>
<TD> mycstutorial </TD> <TD> www.mycstutorial.in </TD> <TD> 8221909045 </TD>
</TR>
</TABLE>
</p>
</BODY>
</HTML>

23. Which attribute of the <TABLE> tag is used to change the background as image?
Answer: BACKGROUND
<table backgroud =”d:\mycstutorial\tabledemo.jpg”> …. </table>
24. Which attribute of the <TABLE> tag is used to change the background color?
Answer: BGCOLOR
<table bgcolor =”cyan”> …. </table>
<table bgcolor =”#58FFA9″> …. </table>
25. Differentiate between BGCOLOR and BACKGROUND?
Answer: BGCOLOR changes the background as color while BACKGROUND changes the background as an image.
26. Write an HTML code to show the uses of BGCOLOR and BACKGROUND attribute of <TABLE> tag?
Answer: Code to show the uses of BGCOLOR & BACKGROUND –
<!DOCTTYPE html>
<HTML>
<HEAD>
<TITLE> Creating Table in HTML </TITLE>
</HEAD>
<BODY>
<H2 ALIGN="CENTER">www.mycstutorial.in</H2>
<HR>
<h2> BGCOLOR </h1>
<TABLE BORDER="3" BGCOLOR = "CYAN">
<TR>
<TD> Web Site Name </TD> <TD> Web URL </TD> <TD> Mobile Number </TD>
</TR>
<TR>
<TD> mycstutorial </TD> <TD> www.mycstutorial.in </TD> <TD> 8221909045 </TD>
</TR>
</TABLE>
<h2> BACKGOUND</h1>
<TABLE BORDER="3" BACKGROUND = "C:/Users/Anjeev%20Singh/Pictures/informatics%20practices%20sample%20papers.PNG">
<TR>
<TD> Web Site Name </TD> <TD> Web URL </TD> <TD> Mobile Number </TD>
</TR>
<TR>
<TD> mycstutorial </TD> <TD> www.mycstutorial.in </TD> <TD> 8221909045 </TD>
</TR>
</TABLE>
</BODY>
</HTML>
