如何在 JSP 中隐藏 <td> 元素的内容?

How to hide the content of a <td> element in a JSP?

我想防止在 JSP 中编辑或删除 table 中的条目。 table 定义为:

<table class="table table-striped">
    <thead>
        <tr>
            <th style="text-align: center">id</th>
            <th style="text-align: center">description</th>
            <th style="text-align: center">url</th>
            <th style="text-align: center">port</th>
            <th style="text-align: center">username</th>
            <th style="text-align: center">password</th>
            <th style="text-align: center">actions</th>
        </tr>
    </thead>
    <tbody id="pojoTable">
        <c:forEach var="pojo" items="${pojoList}" varStatus="loop">
            <tr class="${loop.index % 2 == 0 ? 'even' : 'odd'}">
                <td style="text-align: center">${pojo.id}</td>
                <td style="text-align: center">${pojo.description}</td>
                <td style="text-align: center">${pojo.url}</td>
                <td style="text-align: center">${pojo.port}</td>
                <td style="text-align: center">${pojo.username}</td>
                <td style="text-align: center">${pojo.password}</td>
                <td style="text-align: center">
                    <c:if test="${pojo.description} ne 'FTP Connection Not Valid'" >
                        <a href="<c:url value="../ftp/edit" />?id=${pojo.id}">
                            <button class="btn">edit</button>
                        </a>
                        <a href="<c:url value="../ftp/remove" />?id=${pojo.id}">
                            <button class="btn">remove</button>
                        </a>
                    </c:if>
                </td>
            </tr>
        </c:forEach>
    </tbody>
</table>

想法很简单。当描述匹配 'FTP Connection Not Valid' 时,我希望编辑和删除按钮不出现在单元格操作上,但仅适用于此类行。

如何实现? JavaScript?

只是语法错误。这个

<c:if test="${pojo.description} ne 'FTP Connection Not Valid'" >   

应该是

<c:if test="${pojo.description ne 'FTP Connection Not Valid'}" >