You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by Jack Lauman <jl...@nwcascades.com> on 2004/05/20 20:31:27 UTC

c:choose question

I am trying to format a table so that it displays the date in the first 
column on the first row and not display it again until the date changes 
to the next day.  I have tried the following code to get this to work. 
Any suggestion on how to solve this problem would be appreciated.

I've tried the display taglib but it's overkill for this.


<table>
     <tr align="center">
	<th>Date</th>
	<th>Time</th>
	<th>am/pm</th>
	<th>Height</th>
	<th>Condition</th>
     </tr>

     <c:forEach var="row" items="${result.rows}">
     <fmt:parseDate value="${row.date}" var="parsedDate" 
pattern="yyyy-MM-dd"/>
     <tr>
     <c:choose>
	<c:when test="${parsedDate == parsedDate}">
	<td align="left"><""/></td>	
	<c:otherwise>
	<td align="left"><fmt:formatDate value="${parsedDate}" pattern="E'., 
'MMM d"/></td>
	</c:otherwise>
	<c:when>
	</c:choose>
	<td align="right"><c:out value="${row.Time}"/></td>
	<td align="center"><c:out value="${row.Am_Pm}"/></td>
	<td align="right"><c:out value="${row.Height}"/></td>
	<td align="center"><c:out value="${row.Cond}"/></td>
     <tr>
     </c:forEach>
</table>



---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org