Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DIV overflow inside TABLE

 
Alex Anderson
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

i have a problem with getting a DIV to overflow inside a TABLE.
The code below does not scroll the table cell, but instead the whole screen is scrolled.

Is it possible to make the table 100% in width and height (of the browser window), and then just make the cell with the div tag scroll??





[ December 15, 2005: Message edited by: Alex Anderson ]
[ December 15, 2005: Message edited by: Alex Anderson ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64632
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not something I've played much with, but I believe you may have to specify dimensions for the div to trigger the desired behavior. But that's just a guess.
 
Alex Anderson
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A specific height is just what i don't want to specify.

If i put a height in the style tag like


it works partially, but then i don't get the dynamics I want. I want the table to take 100% in height and width of the browser window.
[ December 15, 2005: Message edited by: Alex Anderson ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64632
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd try dimensions of 100% which should scale the div to the size of its containing cell.
 
Alex Anderson
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree with you that sounds lika a decent solution, but unfortunately that doesn't work.
 
Alex Anderson
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Got it working with some javascript. But i really don't want to use javascript here.. should be a better solution to this.


(some spaces added to make the forum post to work)
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64632
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Works as expected in Safari, but not Firefox. Can't speak for IE.
 
Alex Anderson
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for trying it!
Did some changes so now it works in Explorer, Netscape, Firefox and Opera atleast.


(remove spaces to if you want to try it)

Reused code from this page: http://www.quirksmode.org/js/winprop.html

[ December 16, 2005: Message edited by: Alex Anderson ]
[ December 16, 2005: Message edited by: Alex Anderson ]
 
Rob Hunter
Ranch Hand
Posts: 832
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't know if I'm fully understanding this or not but why set the td tag's width property to 100% and the height to a 100%? What happens if you left out the width specification and specified the third TD tag's width and set the closing TR tag to 100%? When you say it scrolls thwe whole page, is it scrolling the whole page both vertically and horizontally? Just curious is all. I've used DIV's tags in the recent past with tables as well as includng scriptlets like you are and found out a few things about it as well.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic