473,382 Members | 1,171 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,382 software developers and data experts.

Div Dynamic Size

101 100+
Hi,

I have a Div of Height:285px used for a scrolling table.

I want to control the size of div dynamically on the basis of record if the table has 20+ records it show full height of the div (285px) but if it have less then 20 record the size of Div decreases acordingly..... like it have 10 records the height reduced to 150px etc..


Please help how to implement this in both browsers mozilla & IE.


Regards,
Nov 17 '07 #1
4 13560
realin
254 100+
Hi,

I have a Div of Height:285px used for a scrolling table.

I want to control the size of div dynamically on the basis of record if the table has 20+ records it show full height of the div (285px) but if it have less then 20 record the size of Div decreases acordingly..... like it have 10 records the height reduced to 150px etc..


Please help how to implement this in both browsers mozilla & IE.


Regards,

my solution may suck big time, but u can still give a try since u got no replies :p
I am really a loser in CSS but if i were in ur boots, i would have given a pseudo height or no height to the div.. now when the records are fetched the height is automatically adjusted..

Alternatively, you can try this tag in CSS
Expand|Select|Wrap|Line Numbers
  1. Overflow:scroll 
  2. or 
  3. overflow:auto;
hope this helps u a bit atleast.

cheers !!
Nov 17 '07 #2
drhowarddrfine
7,435 Expert 4TB
Not overflow:auto but height:auto will work. Overflow will work but that may cause other problems later since it's used to control elements that can flow out of an element, like floated elements.
Nov 18 '07 #3
buntyindia
101 100+
Not overflow:auto but height:auto will work. Overflow will work but that may cause other problems later since it's used to control elements that can flow out of an element, like floated elements.
drhowarddrfine, i have to maintain minimum height of 285px if records are more then 20. Height:auto works good for less records but when records are more then 20 it is increasing the height as well.

How cani maintain height ?
Nov 18 '07 #4
drhowarddrfine
7,435 Expert 4TB
In that case:
{
height:150px;
min-height:150px;
}

You need both because min-height only works in modern browsers and not Internet Explorer, but IE treats height like min-height and ignores min-height. (Stupid, eh?)
Nov 18 '07 #5

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

Similar topics

4
by: Scott Lyons | last post by:
Hey all, Can someone help me figure out how to pass a dynamic array into a function? Its been giving me some trouble, and my textbook of course doesnt cover the issue. Its probably something...
5
by: meyousikmann | last post by:
I am having a little trouble with dynamic memory allocation. I am trying to read a text file and put the contents into a dynamic array. I know I can use vectors to make this easier, but it has to...
3
by: MikeY | last post by:
Hi Everyone, I am working in C#, windows forms.My question is this. All my button dynamic controls properties are present and accounted for except for the"FlatStyle" properties. I can't seem to...
6
by: Materialised | last post by:
Hi Everyone, I apologise if this is covered in the FAQ, I did look, but nothing actually stood out to me as being relative to my subject. I want to create a 2 dimensional array, a 'array of...
3
by: Stephen Gennard | last post by:
Hello, I having a problem dynamically invoking a static method that takes a reference to a SByte*. If I do it directly it works just fine. Anyone any ideas why? I have include a example...
6
by: MikeY | last post by:
Hi Everyone, Does anyone know where I can get my hands on a sample with source code of a simple dynamic button control in C# Windows form. I am looking for a sample that uses a class library...
2
by: Luis Arvayo | last post by:
Hi, In c#, I need to dynamically create types at runtime that will consist of the following: - inherits from a given interface - will have a constructor with an int argument
13
by: jimjim | last post by:
Hello, I am coming from a C background and the below dynamic allocation of an array of pointers makes sense to me: #define SIZE 2 int **p; p = malloc ( SIZE * sizeof ( int * )); for(int j=0;...
7
by: Joey | last post by:
I don't care what .net language this come in but I really need to determine if a disk is dynamic or basic. I have posted something in the WMI group but no one knows how to do it. Does anyone have...
13
by: coosa | last post by:
Dear all, Using the conio implementation i wanted to create a dynamic string, whereby its size would be determined after each keyboard hit; in other words, i don't want to ask the user to...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.