how to apply style to 'title' attribute of 'td' tag

This may not have been possible many years ago - but now yes you can style the Title attribute, See here . This should work in IE7+, Safari 3+, Firefox 2.0+.

Some custom styling and positioning may be required to suite your own design.

Just to make sure this link does not go dead, the suggested code in this article to style the title attribute is:

<div title="Tooltip text for first div"></div> <div title="Tooltip text for second div"></div>

div:before{ content:attr(title); display:none; }

div:hover::before{ width:200px; display:block; background:yellow; border:1px solid black; padding:8px; margin:25px 0 0 10px; }

div:hover{ z-index:10; position:relative; }

Not directly.

You can do it with:

  • JavaScript code: see here

  • a library: see here

  • a little workaround with CSS see here


This won't style the TD but it's a quick work around that may be what you're looking for:

<td><a title="Sample Title">test</a></td>

Tags:

Html

Css