list - How to add row to top of a table in java -


i using java add rows table. able add row table @ end of list using following code:

list list = (list) session.getattribute("list"); detailsmod mod = new detailsmod(); list.add(mod); 

if change last line to:

list.add(0, mod); 

it add first column top of table while rest of columns remain @ bottom of table.

the html looks smth this:

<%  list resultlist = (list) session.getattribute("list"); detailsmod bean = new detailsmod();     if(resultlist.size() > 0 )  {         for(int i=0; i<resultlist.size(); i++){          bean = (detailsmod) resultlist.get(i); %> <tr>                    <td height="17">       <input name="tbx_a<%=i%>"value="<%=bean.geta()%>" readonly/>    </td>    <td height="17">       <input name="tbx_b<%=i%>" value="<%=bean.getb()%>" />    </td> </tr> <% } }%> 

so yeah... how add entire row top of table? in advance possible help!

use listiterator add particular row in particular index.

  • add new value @ point.
  • set new value @ point.

Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

c# - must be a non-abstract type with a public parameterless constructor in redis -

ajax - PHP/JSON Login script (Twitter style) not setting sessions -