473,804 Members | 3,674 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to make a scrollable div with percentage height

6 New Member
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 8089
harshmaul
490 Recognized Expert Contributor
Which browser are you using?
Feb 20 '08 #2
sariset
6 New Member
i am using internet explorer
Feb 20 '08 #3
sariset
6 New Member
can anyone help me out in this issue
Feb 21 '08 #4
harshmaul
490 Recognized Expert Contributor
have you tried filling out the divs with content?,

that should make the scrolling bars work
Feb 21 '08 #5
sariset
6 New Member
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 Recognized Expert Contributor
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
sariset
6 New Member
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 Recognized Expert Contributor
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 Recognized Expert Expert
position:fixed does not work in IE6. It does work in IE7 but can cause 'haslayout' issues.
Feb 21 '08 #10

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

Similar topics

6
8863
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 src=whatever>whatever</img> the image will not resize. Can this be done ? Tia.
3
10889
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 fixed nor percentage) for this table cell? Sizing the element to 100% width and height does not work, as the parent element's width and height are not specified. And yet, in this case at least, the width and height of the table cell are very...
8
7420
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 to duplicate the effect in Mozilla/Firefox the code is here: http://www.fogcat.co.uk/example/example.html Can anyone point me in the right direction - or at least tell me if it is or isn't possible to get the same functionality in Firefox
25
36372
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 scrollable (with the ordinary scrollbars, no less). Whatever I try, the columns in the head and the body aren't aligned; the widths are computed independently which gives a completely ragged look. Michael --
22
6979
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 adjust according to dynamic screen size, and I have been able to adjust the width to a percentage value which works fine. But if I try do the same with the height it shows some very strange results squashing the field to display about 3 lines.
0
1421
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 same width, no matter what height or width the browser window is. I've tried the following, but neihter Firefox, nor IE6, wants anything to do with it:
6
28103
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. Each box takes up 50% of the parent. 2. One of the box has a border width of 1px.
1
16981
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 examples I found on the web. Works in IE and mozilla. http://www.imaputz.com/cssStuff/bigFourVersion.html
0
9704
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9572
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10562
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10303
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9132
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7608
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6845
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4282
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2978
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.