in reply to I need help with some logic
If your HTML uses tables, it would make this a lot easier.
Good luck.
Russ Brainbench 'Most Valuable Professional' for Perl