Can a table have more than one table header? I mean is it legal as per w3c standards either in html(4/5) or xhtml.
To apply the header row formatting to multiple rows in the table: after the table style is applied, select the rows you want included in the "header row" and on the Table tools > Layout tab, click Repeat Header Rows. If header row is ticked in Design tab > Table style options, you will see your header row formatting.
if you want to have some headers for a header you can use colspan attrebute for example if you want have 2 header for a header you can use colspan="2" for first header i wish i understood your mean. also for tables ,, not for this problem you can use class="table" from bootstrap.
[Content of the <table> element is:] optionally a caption element, followed by zero or more colgroup elements, followed optionally by a thead element, [...] The same is said in the HTML4 specification, so, a table may have only one header.
You can add headers or footers at the top or bottom of a printed worksheet in Excel. For example, you might create a footer that has page numbers, the date, and the name of your file.
Table header is expressed by the tag <thead>
. The tag <th>
is a header cell, so it is not clear what you meant, because in your example you have used only <th>
elements placed in the body section.
The definitive source of wisdom is the HTML5 specification, which says:
[Content of the
<table>
element is:] optionally a caption element, followed by zero or more colgroup elements, followed optionally by a thead element, [...]
The same is said in the HTML4 specification, so, a table may have only one header.
On the other hand, the header cell elements (<th>
) may be placed in any section of the table - header, footer or body. (The same applies to data cells -<td>
)
A <th>
in the body section represents a row header or column header or other headers, depending on the "scope" attribute or context.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With