I'm creating an HTML table dynamically in a JSP using Java for loop. But when I'm trying to assign a unique id to each TD by its position in table, I get a compilation error.
what I would like to do is some sort of:
<TD id="<% new String(row*ROWS+col) %>>
this is the code of the jsp:
<TABLE border="1">
<% for (int row = 1; row <= ROWS; row++) { %>
<TR>
<% for (int col = 1; col <= COLS; col++) {%>
<TD id="????"> (<%=col%>, <%=row%>)
</TD>
<% } %>
</TR>
<% } %>
</TABLE>