Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OVERFLOW: scroll only shows vertical, need horizontal

Status
Not open for further replies.

Billkamm

Programmer
Feb 9, 2006
74
US
I am using OVERFLOW: scroll on a TD tag and it is only showing a vertical scrollbar (this scrollbar appears even without OVERFLOW: scroll). What is the correct CSS syntax to place a horizontal scrollbar for an entire table cell?
 
What you're using should work. Are you sure you have enough content in the cell to make the horizontal scrollbar appear? Can we see your code?
 
Code:
<td align="left" valign="top" style="width: 941px; overflow: scroll;">
<!--ASP.Net 2.0 Gridview renders a table here-->
</td>

Here is the abridged version of what the rendered table looks like between those tags:

Code:
<table width="" height="500px" cellspacing=0 cellpadding=0 style="display:inline"><tr><td><div>
	<table cellspacing="0" cellpadding="4" align="Left" border="0" style="color:#333333;height:500px;border-collapse:collapse;">
<!--CONTENTS HERE -->
	</table>
</div></td></tr></table>

That internal table that displays all the information definitely has enough data to make it extend across the screen. Looking at this I think it might be possible that since I have "width: 941px" as part of my CSS on that cell that even though the table scrolls off the page since it hasn't reached 941px there is no scrollbar? Is this assumption correct? Any suggestions would be helpful. Thank you.
 
overflow: auto and removing the width attribute didn't either :(
 
might style="display:inline" in the internal table be causing a problem?
 
It could be. I would rather not think what confusion the browser would get in if it would try to display table as inline and put table rows, table cells and divs inside.
 
I found something interesting that is occurring. The horizontal scrollbar only displays if MSIE is resized first. I'm not exactly sure why this is. Also, I'm having trouble getting scrollbars to appear in a nested table if there are already scrollbars on the outer table.
 
What is the reason of you having so many nested tables? Have you thought about a more straightforward design?
 
Vragabond: I'm doing a small part of a large project. My piece of the puzzle is nested into several layers of tables. In addition we are using ASP.Net 2.0 to create this site and it renders a lot of its objects into HTML tables, so in order to take advanatage of hte tools ASP.Net has to offer we don't have much of a choice, but to have nested tables everywhere.
 
It turns out that in MSIE the CSS Overflow attribute does not work with the table tag and you must put this in a DIV tag around the TABLE tag. In addition the tables around my piece sized dynamically causing the width/height never to be such that scrollbars were needed.

Thanks to everyone for the responses.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top