Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

More than one table header

Tags:

html

xhtml

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.

like image 936
aWebDeveloper Avatar asked Sep 05 '11 07:09

aWebDeveloper


People also ask

How do I make a table with multiple headers?

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.

Can an HTML table have 2 headers?

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.

Can a table have two heads?

[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.

Can you have more than one header in Excel?

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.


1 Answers

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.

like image 69
Arsen7 Avatar answered Nov 03 '22 00:11

Arsen7