473,385 Members | 1,838 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

how to make a scrollable div with percentage height

here is a sample of my problem

Expand|Select|Wrap|Line Numbers
  1. <table style="width:100%;height:100%">
  2.             <tr style="height: 60%">
  3.                 <td style="width: 968px">
  4.                     <div style="height: 100%;overflow:scroll;">
  5.                         <div style="height: 100px;" >
  6.                             content
  7.                         </div>
  8.                         <div style="height: 100px" >
  9.                             content
  10.                         </div>
  11.                     </div>
  12.                 </td>
  13.             </tr>
  14.             <tr style="height: 40%"><td style="width: 968px"><div style="height: 100%;overflow:scroll">
  15.                         <div style="height: 300px" >
  16.                             content
  17.                         </div>
  18.                         <div style="height: 300px" >
  19.                             content
  20.                         </div>
  21.                     </div></td></tr>
  22.         </table>
  23.  
i am not able to see the scroll bar in action at any time as it is getting expanded.
i dont want to have height in pixels as it may result in indifferent sizes in monitors with different resolutions.

please suggest me a solution for this.
Feb 20 '08 #1
11 7868
harshmaul
490 Expert 256MB
Which browser are you using?
Feb 20 '08 #2
i am using internet explorer
Feb 20 '08 #3
can anyone help me out in this issue
Feb 21 '08 #4
harshmaul
490 Expert 256MB
have you tried filling out the divs with content?,

that should make the scrolling bars work
Feb 21 '08 #5
ya i did that but it is not working so i am looking for a solution for my problem
Feb 21 '08 #6
harshmaul
490 Expert 256MB
I'm looking for a solution too...

Please post your code with the content in the div... chances are the content isn't taking up 300px worth of space.

The content you placed in the posted example is not sufficient to force the overflow.
Feb 21 '08 #7
what exactly is i divided my entire space to 2 rows with 60% and 40% and now i am including div's inside the rows and made them to scroll by using overflow property.if i fix the heigh of the div in pixels i can get the result but it will not fit to screens with different resolutions
Feb 21 '08 #8
harshmaul
490 Expert 256MB
I under stand now!!!

Perfect, set the div to have a position of fixed!

so in the div's styles add this... position:fixed
You may need to tweek the sizes though.
Feb 21 '08 #9
drhowarddrfine
7,435 Expert 4TB
position:fixed does not work in IE6. It does work in IE7 but can cause 'haslayout' issues.
Feb 21 '08 #10
drhowarddrfine
7,435 Expert 4TB
Try setting the height of the containing div in percent instead of px.
Feb 21 '08 #11
even though i fix the div size to percentages it does't reflect the look the feel as the content within div is in pixels. i even tried fixing the entire controls in percentages and ended in a islanded position still
Feb 22 '08 #12

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: | last post by:
Hello all, This is an IE6 question: When I click on an image file on my desktop, ie will automatically resize the image to fit the window. But, when I use html to load the image, i.e. <img...
3
by: Thomas Mlynarczyk | last post by:
Hello, How can I make an <a> element (containing text only, styled to be a box with a border) as big as the table cell in which it resides, *without* having specified any width/height (neither...
8
by: Vic | last post by:
I've managed to achieve the effect I wanted in IE6 - although I had to use an experession to set the vertical height of a div (I want it to have an overflow and scroll) but I can't work out a way...
25
by: Michael Schuerig | last post by:
I'm trying to do something seemingly very simple, but it's brought me close to crushing my head on the keyboard. All I want is a table where the head row is fixed and the body columns below are...
22
by: Les Juby | last post by:
I am trying to adjust the window/table size of a website (www.worklaw.co.za) which has made use of DIV tags with its settings embedded in an CSS file. The client wants its width and height to...
0
by: Quivis | last post by:
Hello, I have this idea for a "normal" css layout, header, scrollable area, footer, but I want the footer "static", in the sense that it should stay at the bottom of the window, and have the...
6
by: Hacking Bear | last post by:
Hi, I still don't quite fully understand how to handle mixing border/margin pixel width with percentage width. In the example below, I want to place side-by-side two DIV boxes inside a box....
1
by: since | last post by:
I figured I would post my solution to the following. Resizable column tables. Search and replace values in a table. (IE only) Scrollable tables. Sortable tables. It is based on a lot...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.