• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Simple question

 
jose chiramal
Ranch Hand
Posts: 266
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

<logic:present name="list">
<table border="0" cellspacing="0" cellpadding="0" align="center" width="70%" style="border-collapse:collapse;">
<tr bgcolor="#98AFCC">
<th>User ID</th>
<th>First Name</th>
<th>Last Name</th>
<th>Email</th>
</tr>
<%boolean even = false; %>
<logic:iterate id="user" name="list">
<% even = !even; %>
<tr bgcolor="<%=even?"#B7D3F5":"#D6E0F5" %>"> (what is #B7D3F5 and #D6E0F5 ? And how does the "even" boolean variable work here?) <td>
<bean:write name="user" property="userId" />
</td>
<td>
<bean:write name="user" property="firstName" />
</td>
<td>
<bean:write name="user" property="lastName" />
</td>
<td>
<bean:write name="user" property="email" />
</td>
</tr>
</logic:iterate>
<tr>
<td colspan="6" align="center">
<a href="adduser.jsp">Add New User</a>
</td>
</tr>
</table>
</logic:present>

 
Vinod Tiwari
Ranch Hand
Posts: 466
1
IntelliJ IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is for setting background color.... refer some html tutorial.
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is #B7D3F5 and #D6E0F5 ?

Hex color code.
And how does the "even" boolean variable work here?

Its ternary operator, and its takes the boolean as its first parameter, right ?

And Use meaningful subject line and edit the post with code tags.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic