鼠标悬停标题问题

发布于 2025-01-07 18:50:01 字数 1769 浏览 2 评论 0原文

大家好,我想将 单元格的所有内容放入 mouseOver 中。我目前正在执行 forEach 用元素填充单元格。有些单元格中有一个元素数组。我希望单元格中的内容也是鼠标悬停时出现的内容。我不确定如何格式化 title= 以适应。

<table align="center" class="data_extract vert_scroll_table" >
    <tr>
        <c:forEach var="heading" items="${results.headings}"> 
            <th class="data_extract">${heading}</th>
        </c:forEach>
    </tr>
    <c:forEach var="row" items="${results.data}">
        <tr>
            <c:forEach var="cell" items="${row}" varStatus="rowStatus">
                <td class="data_extract">
                    <c:choose>
                        <c:when test="${results.types[rowStatus.index].array}">
                            <c:forEach var="elem" items="${cell}" varStatus="cellStatus">
                                <span class="mouseover_text" title="${elem},&nbsp;">${elem}<c:if test="${!cellStatus.last}">,&nbsp;</c:if></span>
                            </c:forEach>
                        </c:when>
                        <c:otherwise>
                            ${cell}
                        </c:otherwise>
                    </c:choose>
                </td>
            </c:forEach>
        </tr>
    </c:forEach>
</table>

我基本上想要在循环完成后:

<c:when test="${results.types[rowStatus.index].array}">
    <c:forEach var="elem" items="${cell}" varStatus="cellStatus">
        ${elem}<c:if test="${!cellStatus.last}">,&nbsp;</c:if>
    </c:forEach>

将结果放在标题中:

<span class="mouseover_text" title=  </span>

Hello all I want to place all the contents of a <td> cell into a mouseOver. Im currently doing a forEach to populate the cells with elements. Some cells have an array of elements in it. I want whats in the cell to also be what comes up on the MouseOver. Im not sure how to format the title= to accomodate.

<table align="center" class="data_extract vert_scroll_table" >
    <tr>
        <c:forEach var="heading" items="${results.headings}"> 
            <th class="data_extract">${heading}</th>
        </c:forEach>
    </tr>
    <c:forEach var="row" items="${results.data}">
        <tr>
            <c:forEach var="cell" items="${row}" varStatus="rowStatus">
                <td class="data_extract">
                    <c:choose>
                        <c:when test="${results.types[rowStatus.index].array}">
                            <c:forEach var="elem" items="${cell}" varStatus="cellStatus">
                                <span class="mouseover_text" title="${elem}, ">${elem}<c:if test="${!cellStatus.last}">, </c:if></span>
                            </c:forEach>
                        </c:when>
                        <c:otherwise>
                            ${cell}
                        </c:otherwise>
                    </c:choose>
                </td>
            </c:forEach>
        </tr>
    </c:forEach>
</table>

I basically want after the loop is done here:

<c:when test="${results.types[rowStatus.index].array}">
    <c:forEach var="elem" items="${cell}" varStatus="cellStatus">
        ${elem}<c:if test="${!cellStatus.last}">, </c:if>
    </c:forEach>

To put the results here in the title:

<span class="mouseover_text" title=  </span>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

酸甜透明夹心 2025-01-14 18:50:01

如果我正确理解您的问题,则您的跨度标签中的标题标签未正确生成。

看看下面的代码是否适合您的问题。如果没有,请更清楚地解释一下。

 <c:forEach var="elem" items="${cell}" varStatus="cellStatus">
    <c:choose>
        <c:when test="${cellStatus.count ==1}>
            <c:set var="temp" value="${elem}"/>
        </c:when>
        <c:otherwise>
            <c:set var="temp" value="${temp}, ${elem}"/>
        </c:otherwise>
    </c:choose>
    <span class="mouseover_text" title="${temp}">${elem}<c:if test="${!cellStatus.last}">, </c:if></span>
</c:forEach>

If I understand your question properly, the title tag in your span tag is not getting generated properly.

See if the below code suits your problem. If not please explain it little bit more clearly.

 <c:forEach var="elem" items="${cell}" varStatus="cellStatus">
    <c:choose>
        <c:when test="${cellStatus.count ==1}>
            <c:set var="temp" value="${elem}"/>
        </c:when>
        <c:otherwise>
            <c:set var="temp" value="${temp}, ${elem}"/>
        </c:otherwise>
    </c:choose>
    <span class="mouseover_text" title="${temp}">${elem}<c:if test="${!cellStatus.last}">, </c:if></span>
</c:forEach>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文