Hiding the Element after doing some comparison

Hiding the Element after doing some comparison

Hi All,
 
For a long time  I am struck badly dealing with Pagination issue in J2EE application.The way I need I paginate the records is something for which I am not able to think of correct logic other then using collections list.So I wanted to check if there exists anyway I can use Jquery to hide the elements based on some comparison.
Below is what I required,
 
Date10
Title 100
Title 99
Title98
Title97
Date09
Title96
Title95
Date08
Title94
Title93
...
Title00
 
Now for each date I want to display title, with date going as header and each page displays 100 records followed by next link.
 
Now this is what I have
 
<p>Date 10</p> Title 100
<p>Date 10</p> Title 99
<p>Date 10</p> Title 98
<p>Date 09</p> Title 97
<p>Date 09</p> Title 96
<p>Date 09</p> Title 95
<p>Date 08</p> Title 94
<p>Date 08</p> Title 93
.....
 
<p>Date 01</p> Title 10
 
 
Each date can contain N number of titles.
 
Now what I am looking for its , Compare the first date with each of the date tags, if they are unqual, it should create the header with value as that date and use that date for further comparsion for downstream dates and repeat the same process till last date element.I expect max 100 dates on each page.
 
Can someone help me on this.