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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 04:22:02  来源:igfitidea点击:

display an alternate text on mouseover for a table entry

html

提问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

altis an attribute, not a tag, and it is not for mouse over, it shows up when image is not loaded, try using titleinstead

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 titlefor this problem. And it is comparative easy solution

使用title这个问题。它是比较容易的解决方案

<table>
    <tr>
        <td title="Employee Name."> Employee ID</td>
    </tr>
</table>