Hello,
I am storing avatar images in a table dynamically.
I want to store only 2 avatars in a row, but there may exists any no of avatars. Also in the view i want only to show 3 rows. The remaining must be hidden. When i click some button i want the other 3 rows to be showed and so on.
Is that really possible? Thankyou

Recommended Answers

All 6 Replies

Hello,
I am storing avatar images in a table dynamically.


Why do you need a table?

I want to store only 2 avatars in a row, but there may exists any no of avatars. Also in the view i want only to show 3 rows. The remaining must be hidden. When i click some button i want the other 3 rows to be showed and so on.


Set a height on the element (use em not px) and set overflow: auto;

hi, thanks this works for me. But i

need some changes here. I set the overflow to be hidden. Then i place 2 buttons, when i press the rightbutton the 3&4 div must be show and when leftbutton 1&2 button to be shown. Is that possible?

<html>
<body>
<head>
<style type="text/css">
#div1
{
	float: left;
	overflow: auto;
	width: 7.5em;
	height: 7em;
	background-color: red;
	vertical-align: top;
}
#subdiv1,#subdiv2,#subdiv3,#subdiv4
{
	float:left;
	background-color: green;
	width: 50px;
	height: 75px;
}
</style>

</head>
<body>
<table border="1" cellpadding="0" cellspacing="0">
<tr>
	<td id="div1">
		<table border="1" cellpadding="0" cellspacing="5">
			<tr>
				<td><div id="subdiv1">1</div></td>
				<td><div id="subdiv2">2</div></td>
				<td><div id="subdiv3">3</div></td>
				<td><div id="subdiv4">4</div></td>
			</tr>
		</table>
	</td>
</tr>
</table>
</body>
</html>

First, you need to fix the HTML errors.

I think i have fixed the error now.

<html>
<head>
<style type="text/css">
#div1
{
	float: left;
	overflow: auto;
	width: 7.5em;
	height: 7em;
	background-color: red;
	vertical-align: top;
}
#subdiv1,#subdiv2,#subdiv3,#subdiv4
{
	float:left;
	background-color: green;
	width: 50px;
	height: 75px;
}
</style>

</head>
<body>
<table border="1" cellpadding="0" cellspacing="0">
<tr>
	<td id="div1">
		<table border="1" cellpadding="0" cellspacing="5">
			<tr>
				<td><div id="subdiv1">1</div></td>
				<td><div id="subdiv2">2</div></td>
				<td><div id="subdiv3">3</div></td>
				<td><div id="subdiv4">4</div></td>
			</tr>
		</table>
	</td>
</tr>
</table>
</body>
</html>

I think i have fixed the error now.


Don't think; check it (with the validator at http://validator.w3.org)/

There are still 2 errors (no DOCTYPE and no TITLE).


Don't think; check it (with the validator at http://validator.w3.org)/

There are still 2 errors (no DOCTYPE and no TITLE).

Ya thankyou, and i know that. Actually i simply posted here for another question and while uploading my page i wil look for the errors and fix it out.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.