Mobiprep has created last-minute notes for all topics of HTML to help you with the revision of concepts for your university examinations. So let’s get started with the lecture notes on HTML.
Our team has curated a list of the most important questions asked in universities such as DU, DTU, VIT, SRM, IP, Pune University, Manipal University, and many more. The questions are created from the previous year's question papers of colleges and universities.
Tables
Question- 1) Mention the HTML Tags used to display data in tabular form.
Answer: 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.
Question- 2) How can rows be made to Span many columns or rows in HTML?
Answer: 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>
Question- 3) Explain the use of caption Tag in HTML.
Answer: 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>
Output-
Registration Record
Month | Number of Registration |
January | 50 |
Commentaires