Floating a div only when certain conditions are met
I have a .jsp that, based on parameters, can have 1 or 2 tables. If开发者_运维问答 only one of the parameters is fulfilled I want to have the table centered. If both parameters are fulfilled I want to float one table left and float the other table right. I can take care of the floating part, I am just unsure on how to have the other condition. I would think this can be done with some sort of 'if' statement....?
You'll most likely need to use a combination of <c:choose />
and <c:if />
.
<c:choose>
<c:when test="${conditionOne && conditionTwo}">
<table class="tableLeft"></table>
<table class="tableRight"></table>
</c:when>
<c:otherwise>
<c:if test="${conditionOne || conditionTwo}">
<table class="tableCenter"></table>
</c:if>
</c:otherwise>
</c:choose>
Hope this helps.
精彩评论