HTML <tr> Tag Documentation
The <tr> tag defines a table row. It goes inside <table>, and usually inside <thead>, <tbody>, or <tfoot>. Each <tr> contains one or more <th> (header) or <td> (data) cells. Use th in header rows and td in body rows for semantic structure and robust accessibility.
Semantic Structure
The hierarchy is clear: Table > thead/tbody/tfoot > tr > th/td. One semantic row equals one <tr>. Employ <th> in thead rows to denote headers; utilize <td> in tbody and tfoot rows for data insertion. Ensure the same number of cells per row for perfectly aligned columns.
Accessibility Best Practices
Always nest <tr> inside a <table> context (and optimally inside thead, tbody, or tfoot). Couple your <th> elements with the scope attribute in header rows to explicitly guide screen readers.
