What is the purpose of the colspan attribute in HTML tables?
- To let the content span across multiple columns.
- To merge rows vertically.
- To set the background color of a column.
- To set the width of a column.
The colspan attribute is used within a
or
element to specify how many columns that cell should span across. This is particularly useful when you want to merge cells horizontally to create headers or group related data. For instance, if you wanted a header to span two columns, you'd use
.
Loading...
Related Quiz
- What is the precedence order of styles defined in the internal and external style sheets?
- What is the purpose of the target attribute in the anchor tag?
- The ______ element is used to define an image map.
- The ______ tag within the head section is used to write internal CSS.
- The ______ attribute is used to specify the form method (get/post).