Bootstrap rowlink,仍然无法正常工作

时间:2013-05-12 02:15:54

标签: jsp spring-mvc twitter-bootstrap

我意识到有很多关于这个特定主题的问题,但我已经尝试了所有这些解决方案,但它们并没有完全奏效。或许我做错了,如果你看到它,请指出。

所以我有一个Spring MVC应用程序,JSP页面实现了Twitter Bootstrap。在其中一个中,我得到了一个由JSTL forEach循环填充的表。这是我似乎无法让它工作的地方。这就是我得到的:

<table class="table table-hover" data-provides="rowlink">
    <thead>
        <tr>
            <th>Title</th>
            <th>Author</th>
            <th>Last Mod</th>
            <th></th>
        </tr>
    </thead>
    <tbody>
        <c:forEach var="recipe" items='${recipes}'>
            <tr>
                <td><a href="/recipes/${recipe.id}">${recipe.inputTitle}</a></td>
                <td>${recipe.author}</td>
                <td>${recipe.timestamp}</td>
                <td><a class="btn btn-small btn-primary" href="/recipes/${recipe.id}"><i class="icon-list icon-white"></i> Detalhe</a></td>
            </tr>
        </c:forEach>
    </tbody>
</table>

这样做基本上是将链接打到第一个字段(标题)上,并且它不会使整个行可单击。另外,如果你知道我的意思,我想是否有可能不像链接那样出现。

我也尝试了<tbody data-provides="rowlink">,几乎我在SO上所有答案中看到的各种组合。

我错过了什么?

由于

修改

some1可以指出正确的方法是什么?也许我错过了什么。

由于

编辑2

感谢@SlavaSemushin,我设法让整个行可以点击,在循环中添加class="rowlink" to the`:

    <table class="table table-bordered table-striped" data-provides="rowlink">
        <thead>
            <tr>
                <th>Title</th>
                <th>Author</th>
                <th>Last Mod</th>

            </tr>
        </thead>
        <tbody>
            <c:forEach var="recipe" items='${recipes}'>
                <tr class="rowlink">
                <a href="/recipes/${recipe.id}">
                    <a href="/recipes/${recipe.id}">${recipe.inputTitle}</a></td>
                    <td>${recipe.author}</td>
                    <td>${recipe.timestamp}</td>

                </a>
                </tr>
            </c:forEach>
        </tbody>
    </table>

我已尝试将class="nolink"添加到已提供链接的<td>,并尝试将其添加到我放置<tr>的{​​{1}},但它没有无论如何都要工作。

因此解决了整个行可点击的问题,我只想删除第一个表字段上的链接突出显示。

0 个答案:

没有答案
相关问题