Putting Array Values into a Table

I have two ArrayList I would like to put these into a table with Arrylist one populating column one and ArrayList populating column two. I am using JSP.

[159 byte] By [SLDykea] at [2007-11-27 10:51:06]
# 1

assuming both arrays are the same size:

try something like this:

<table>

<%for int ii=0;arrayList1.size();++ii){ %>

<tr>

<td>

<%=(String)arrayList1.get(ii)%>

</td>

<td>

<%=(String)arrayList2.get(ii)%>

</td>

</tr>

<%}%>

</table>

The above example is crude and may not compile,but you get the idea.

George123a at 2007-7-29 11:29:11 > top of Java-index,Java Essentials,New To Java...
# 2

just for the record (no pun intended), typically you do tables in record/row format where an ArrayList is the table and each item in the ArrayList would represent a row in the form of some object and each member variable of that object is a column. sorry if that doesn't fit with the discussion, just thought i'd add that

SoulTech2012a at 2007-7-29 11:29:11 > top of Java-index,Java Essentials,New To Java...