Html 在鼠标悬停时显示表格条目的替代文本
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13863358/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
display an alternate text on mouseover for a table entry
提问by user1643087
I have a table one of whose column displays the employee id of the employees. i need to display there names when mouse moves on it . can anyone help me with that??
我有一个表,其中一列显示员工的员工 ID。当鼠标在上面移动时,我需要在那里显示名称。有人可以帮我吗??
回答by Mr. Alien
alt
is an attribute, not a tag, and it is not for mouse over, it shows up when image is not loaded, try using title
instead
alt
是一个属性,不是一个标签,它不是鼠标悬停,它在图像未加载时显示,请尝试title
改用
So try this
所以试试这个
<table>
<tr>
<td title="Employee Name">1</td>
<td title="Another Employee Name">2</td>
</tr>
</table>
回答by A.A Noman
Use title
for this problem. And it is comparative easy solution
使用title
这个问题。它是比较容易的解决方案
<table>
<tr>
<td title="Employee Name."> Employee ID</td>
</tr>
</table>