如何在使用<显示:表格><显示:列>时使表格行可单击

How to make table row clickable while using <display:table> &<display:column>

本文关键字:表格 显示 单击      更新时间:2023-09-26
<display:table class="table" name="regionList" id="elem"
        requestURI="./addCountry.html">
        <display:column property="name" title="Country" />
        <display:column property="code" title="City" />
        <display:column title="&nbsp;">
            <a href="QQQQ.html?id=<c:out value='${elem.id}' />">Edit</a>
        </display:column>
    </display:table>

如何使整个表格行可作为链接点击?

这里有 3 个选项:

  1. 将 hetdiv 包装在锚点中(不是最佳实践,我认为 seo 不喜欢它)
  2. $(".parentdiv").click(function() { window.location = $(this).data("http:///www.location.com"); });
  3. <div onclick="location.href='YOUR-URL-HERE';" style="cursor: pointer;"></div>