I have below table in my jsp with links coming dynamically on page load using java arraylist
<%ArrayList<String> display = ArrayList<String>)session.getAttribute("links"); %>
<table border="0" width="100%" style ="">
<tr></tr>
<td width="20%"></td>
<table border="0" width ="50%" id="LinkDisplay">
<div id="LinkDisplay">
<%if(display!=null){
for(int p=0;p<display.size();p++){%>
<tr><td width="42%"> </td><td><a href="javascript:removeLink('<%=display.get(p)%>')"><%=display.get(p)%></a><br></td><td> </td></tr>
<% } }%>
</div>
</table>
<td></td>
<tr></tr>
</table>
When I click on link, it remove and hide the link calling removeLink javascript function
$('#LinkDisplay a').click(function() {
var $this = $(this);
$this.remove();
}
But when link remove, it leaves the spaces between links. How to remove that space, when link clicked. I tried to hide even tried to remove the empty td element (without link text) but it does not help.. Page with all the links look as below :-
after clicking on links it leaves the spaces as below :-
Also if there are more than 10 links I want to add scroll bars, can we do that on table. If table is not the right way to do all this, is there any other easy way?

