0

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

2
Contributors
6
Replies
7
Views
7 Years
Discussion Span
Last Post by bharanidharanit
0

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;

0

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>
0

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>
0


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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.