我如何...为表格内的锚标签创建自定义工具提示。 [英] How do I... create custom tooltip for anchor tag inside table.

查看:42
本文介绍了我如何...为表格内的锚标签创建自定义工具提示。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我尝试为html表中的锚标签创建toolTip。我需要根据分配给锚标签的数据属性的Id从数据库中获取一些信息。此信息需要在工具提示中显示。

以下是我的Html。

Hi all,

I am try to create toolTip for anchor tags which inside the html table. i need to fetch some information from database based on the Id assigned to data-attribute of anchor tags. this information need to be shown in tooltip.
following is my Html .

<pre lang="HTML"> <thead>
            <tr>
                <th>Id</th>
                <th>Name</th>
            </tr>
        </thead>
        <tbody>

            @foreach (var item in Model)
            {
                <tr>
                    <td><a href="#" data-id="@item.Id">@item.Id</a> </td>
                    <td>@item.Name</td>
                </tr>
            }

        </tbody>
    </table>"









也。我正在使用jquery 1.8.2版本,我无法升级此版本。所以任何人都可以帮我解决这个问题



谢谢和问候

晴天

推荐答案

您可以使用标签的title属性显示工具提示。



You can display the tooltip with title property of a tag.

<table>
<thead>
    <tr>
        <th>Id</th>
        <th>Name</th>
    </tr>
</thead>
<tbody>

    @foreach (var item in Model)
    {
        <tr>
            <td><a href="#" data-id="@item.Id" title="@item.Id">@item.Id</a> </td>
            <td>@item.Name</td>
        </tr>
    }

</tbody>
</table>


您可以采用与以下链接相同的方式完成此操作。你应该使用jQuery工具提示.. 点击此链接
Hi you can do it in the same way as done in the below link. you should use jQuery tooltip..follow this link


这篇关于我如何...为表格内的锚标签创建自定义工具提示。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆