Link to home
Start Free TrialLog in
Avatar of randomst
randomst

asked on

Expand HTML table

Hello experts,
I am generating a table based on a database query result and i want to show only the first 5 results of the table. I want to have a link for expanding the table for showing all the results and then a link for hiding them again.
ASKER CERTIFIED SOLUTION
Avatar of hielo
hielo
Flag of Wallis and Futuna image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Are you using jQuery for this? If so, this should get you started on what you need:
$('tr').slice(5).hide();
	$('.expand').click(function() {
		$('tr').show();
	});

/////////////////

<a href="#" class="expand">Expand Table</a>

Open in new window

Haha, I like the way you think, hielo.
Avatar of randomst
randomst

ASKER

very helpful thanks !