HTML Tables MCQs

This section focuses on "table" in Html. These Multiple Choice Questions (mcq) should be practiced to improve the Html skills required for various interviews (campus interview, walk-in interview, company interview), placement, entrance exam and other competitive examinations.

1. Which HTML tag is used to define a table?

A. <tb>
B. <tl>
C. <table>
D. <tab>

View Answer


2. With the help of which tag, is a row defined in HTML?

A. <row>
B. <table-row>
C. <tablerow>
D. <tr>

View Answer


3. Choose the correct option.

A. <th> is used for defining the heading of a table.
B. By default, contents written between <th> and </th> are bold and centered.
C. Both A and B
D. None of the above

View Answer


4. By using which of the following options, the border of table can be collapsed?

A. border-collapse:collapse
B. table-border:collapse
C. border:collapse
D. table-border-collapse:collapse

View Answer


5. Fill in the blanks with the help of options given below in order to get the following table when the below code is executed.

<!DOCTYPE html>
<html>
<body>
<table border="2">
<tr>
<th>Name</th>
<th>Phone no</th>
</tr>
<tr>
<td ______________>John</td>
<td>9898989898</td>
</tr>
<tr>
<td>9876543210</td>
</tr>
</body>
</html>

Name	Phone no
John	9898989898
 	9876543210

A. colspan= “1”
B. colspan= “2”
C. rowspan= “1”
D. rowspan= “2”

View Answer


6. In order to add space of 20px between cell content and its border of a table in html, which one of the following option is appropriate?

A. th,td{ padding: 20px;}
B. table{ margin:20px; }
C. table{ border : 20px;}
D. table{ padding: 20px; }

View Answer


7. Which one of the following tags is used to add caption to a table?

A. <table-caption>
B. <tcaption>
C. <caption>
D. <tc>

View Answer


8. Which one of the following can be used to define the spacing between the cells of a table?

A. border-spacing
B. spacing
C. cell-spacing
D. table-spacing

View Answer


9. By default, the content written between and are placed at center. How can it be put at left side of the cell of the table?

A. th{ align: left; }
B. th{ text-align: left; }
C. th { font-align:center; }
D. It cannot be done.

View Answer


10. Fill in the blanks with the help of options given below in order to get the following table when the below code is executed.

<!DOCTYPE html>
<html>
<body>
<table border="2">
<tr>
<th>Name</th>
<th ____________>Phone no</th>
</tr>
<tr>
<td>John</td>
<td>9898989898</td>

<td>9876543210</td>
</tr>
</body>
</html>

Name	Phone no
John	9898989898	9876543210

A. colspan= “1”
B. colspan= “2”
C. rowspan= “1”
D. rowspan= “2”

View Answer





Also check :


Discussion


* You must be logged in to add comment.