Question 1
How can you add space around the top and bottom of an image?
Answer
We can use the Vspace attribute to add space around the top and bottom of an image. The value of Vspace is defined in pixels.
For example,
<IMG SRC = "IMAGE.JPG" ALT = "GARDEN" VSPACE = "40">
Question 2
How will you add border to an image?
Answer
We can add border around the image by using the Border attribute. It accepts value in terms of pixels.
For example,
<IMG SRC = "IMAGE.jpg" Border= "5">
Question 3
Differentiate between the Rowspan and Colspan attributes of a table.
Answer
Differences between Rowspan and Colspan attributes of a table are:
S. No. | Rowspan | Colspan |
---|---|---|
1. | ROWSPAN is used to combine the cells vertically. It merges the number of cells vertically and displays them as a single cell. | COLSPAN is used to combine the cells horizontally. It specifies the number of columns that the cells span across and shows them as a single cell. |
2. | E.g. <TD Rowspan= "3"> where 3 is the number of rows that the cells span across. | E.g. <TD Colspan= "4"> where 4 is the number of columns that the cells span across. |
Question 4
How is spacing in cells controlled?
Answer
Spacing in cells is controlled by the following attributes of the <TABLE>
tag.
- Cellspacing — It gives the amount of space between cells.
- Cellpadding — It gives the amount of space between the cell border and the cell contents.
Consider the following example,
<TABLE BORDER = "3" CELLSPACING = "1" CELLPADDING = "1">
<TR>
<TD> Fruits </TD>
<TD> Vegetables </TD>
</TR>
<TR>
<TD> Mango, Apple, Banana </TD>
<TD> Potato, Aubergine, Gourd </TD>
</TR>
</TABLE>
Question 5
How will you add an image of a table at the top of your web page?
Answer
We can use the <IMG>
tag with its attribute 'src' to add an image of a table at the top of our web page. The HTML code is as follows:
<HTML>
<HEAD>
</HEAD>
<BODY>
<IMG SRC = "TABLE.JPG" ALT = "IMAGE OF A TABLE">
...contents of the web page...
</BODY>
</HTML>
Question 6
Write the HTML code to:
i. Align the content of a cell in a Table to the top
ii. Link to a specific section of another webpage
Answer
i. To align the content of a cell in an HTML table to the top, we can use the 'valign' attribute with the value "top" for the <td>
element. Consider the given example,
<TABLE>
<TR>
<TD VALIGN = "TOP"> Mouse </TD>
<TD>Monitor </TD>
</TR>
<TR>
<TD>Keyboard </TD>
<TD>Printer </TD>
</TR>
</TABLE>
ii. To create a link to a specific section of another webpage, we can use anchor tags <a>
with the 'href' attribute pointing to the target webpage and specifying the target section using a '#' followed by the section's 'name' attribute. Consider the given example,
<a href="https://computerhardware.com#inputdevices">Input Devices</a>
Here, "input devices" is the value of the 'name' attribute which refers to a specific section of another webpage.
Question 7
Write the HTML code to send an email to abc@xyz.com
from your web page.
Answer
<HTML>
<HEAD>
<TITLE>Send Email Example</TITLE>
</HEAD>
<BODY>
<A HREF = "mailto:abc@xyz.com">Send Mail to abc</A>
</BODY>
</HTML>
Question 8
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.
Answer
<HTML>
<HEAD>
<TITLE>Table Example</TITLE>
</HEAD>
<BODY>
<TABLE>
<THEAD BGCOLOR = "YELLOW">
<TR> <TD> Names </TD> </TR>
<TR> <TD> Of </TD> </TR>
<TR> <TD> Some </TD> </TR>
<TR> <TD> Fruits </TD> </TR>
</THEAD>
<TBODY BGCOLOR = "ORANGE">
<TR> <TD> Apple </TD> </TR>
<TR> <TD> Mango </TD> </TR>
<TR> <TD> Banana </TD> </TR>
<TR> <TD> Guava </TD> </TR>
</TBODY>
<TFOOT BGCOLOR = "LIGHTGREEN">
<TR> <TD> Note </TD> </TR>
<TR> <TD> Fruits are rich in fibre. </TD> </TR>
</TFOOT>
</TABLE>
</BODY>
</HTML>
0 Comments
Please do note create link post in comment section