top of page

HTML Notes

mobiprep (6).png

HTML

mobiprep (6).png

HTML Tags and Elements

mobiprep (6).png

Attributes and Hyperlinks

mobiprep (6).png

Headings and Lists

mobiprep (6).png

Class and id attributes

mobiprep (6).png

Semantic Elements

mobiprep (6).png

Inline and Block-Level Elements

mobiprep (6).png

Div and Span

mobiprep (6).png

img

mobiprep (6).png

Tables

mobiprep (6).png

Forms

Heading

Q

1

Mention the HTML Tags used to display data in tabular form.

LRM_EXPORT_207556595493866_20190724_1939

Ans

The <table> tag defines a table in HTML. Each table row is defined as <tr> tag. Each header is defined with <th> tag. The data in each cell in table is defined by <td> tag. By default, text in <th> is bold and centered and text in <td> is regular and left aligned.

LRM_EXPORT_207556595493866_20190724_1939

Q

2

How can rows be made to Span many columns or rows in HTML?

LRM_EXPORT_207556595493866_20190724_1939

Ans

Cells may span in several rows and columns. This is done with the help of attributes “rowspan” and “colspan” of &<th> and <td> tag. Function of <colspan> is that it allows a single table cell to span the width of more than one cell or column. Function of <rowspan> is that it allows a single table cell to span the height of more than one cell or row.

Sometimes it makes sense for a cell to span multiple columns or multiple rows. This might be used for a header cell that titles a group of columns, or a side-bar that groups rows of entries. This is why these attributes are used and are a significant part of table in HTML.

Syntax- <Table>
<tr><td colspan= "add_number_ofcols"></td></tr>
<tr> <td rowspan= "add number of rows></td></tr>
</table>

LRM_EXPORT_207556595493866_20190724_1939

Q

3

Explain the use of caption Tag in HTML.

LRM_EXPORT_207556595493866_20190724_1939

Ans

The <caption> tag defines a table in HTML. The <caption> tag must be inserted immediately after the <table>tag.
Example of <caption> tag-
<table>
<caption>Registration record </caption>
<tr>
<th>Month</th> <th>Number of registration </th>
</tr>
<tr>
<td>January</td><td>50</td>
</tr> </table>

LRM_EXPORT_207556595493866_20190724_1939
bottom of page