The title attribute on a <th> tag adds a tooltip with title text to the table header cell.
Hovering the mouse over the header cell will display the tooltip.
A title attribute on a <th> element.
Full name | |
---|---|
Denice | Hobermann |
Paulo | Cornell |
<style>
table.tb { width: 250px; border-collapse: collapse; }
.tb th, .tb td { border: solid 1px #777; padding: 5px; }
.tb th { background-color:lightblue; text-align: center; }
</style>
<table class="tb">
<tr>
<th title="Customer full name" colspan="2">Full name</th>
</tr>
<tr>
<td>Denice</td>
<td>Hobermann</td>
</tr>
<tr>
<td>Paulo</td>
<td>Cornell</td>
</tr>
</table>
The title attribute is placed in the <th> opening tag.
The value can be any string. Hover over the th and a tooltip appears.
The title attributes attaches additional information to the <th> element.
The title value displays as a tooltip.
The tooltip displays when the th element is hovered.
<th title="value">
Value | Description |
---|---|
value | A string value. A title can span multiple lines by including newline or carriage-return characters: or 
. |
Here is when title support started for each browser:
Chrome
|
1.0 | Sep 2008 |
Firefox
|
1.0 | Sep 2002 |
IE/Edge
|
1.0 | Aug 1995 |
Opera
|
1.0 | Jan 2006 |
Safari
|
1.0 | Jan 2003 |
Back to <th>