473,407 Members | 2,306 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,407 software developers and data experts.

Table which resizes horizontally and vertically with the browser window

4
Hi,

I need to have a table along with other UI items in page which resizes horizontally and vertically with the browser window. That means table should accoupy the remaining available space in the browser window and should display horizontal and vertical scroll bars if content of table is more than available width & height.

I can do similer to this by enclosing table in a <DIV> with style as : overflow:auto; height:200px etc.
But things is I don't want to hardcode the height size here in style. Height should be automatically adjusted in the browser.

I did something else as below:


Expand|Select|Wrap|Line Numbers
  1. <table border="0" width="100%" height="100%">
  2.  <tr>
  3.    <td height="100%">
  4.       <div class="divScroll">
  5.          <table id="myTable" cellspacing="1" class="gridTable" width="100%" height="100%">
  6.             tr td here....
  7.          </table>
  8.       </div>   
  9.    </td>
  10.  </tr>
  11. </table>
  12.  
  13. .divScroll {
  14.         position:static; 
  15.         height:100%; 
  16.         z-index:1; 
  17.         overflow:scroll     
  18. }
But here I don't get DIV horizontal scroll bar infact I got window horizontal scroll bar though I get DIV vertical scroll bar.

Any help..code snippet is highly appericiated.

TIA,Sachin
Dec 15 '06 #1
2 4684
AricC
1,892 Expert 1GB
Try
[html]
<table style="height: auto;width: auto;etc.." cellspacing="1"><tr><td>etc..</table>
[/html] or post a link I'm not really sure what else your looking to do also you may not need position: static that is usually if your trying to override previously placed positioning.
Dec 15 '06 #2
sachjn
4
Try
[html]
<table style="height: auto;width: auto;etc.." cellspacing="1"><tr><td>etc..</table>
[/html] or post a link I'm not really sure what else your looking to do also you may not need position: static that is usually if your trying to override previously placed positioning.
Thanks for reply. Please bear with me as I am not an expert in HTML/CSS..:)

I'll put my question other way, please propose any solution:

I need a table in a DIV tag so that I can get horizontal and vertical scrolling for DIV if table content width/height is more than the available space in the page. It works all fine if I specify DIV width/height in px. But I don't want to hard code the size (Height/Width). As I said earlier somehow I could achieve this for height but for width I am unable to do it. I always end up in page horizontal scroll bar which I don't want. I have some 30 odd columns in the table.

TIA,Sachin
Dec 18 '06 #3

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

Similar topics

32
by: Rich | last post by:
I'm sure it sounds kinda nutty to display 200 columns and 500,000 rows of data. But I have been pulling data from a Lotus Notes database into Sql Server for a while now, but Lotus Notes is...
10
by: john T | last post by:
Is there anyway to vertically center a html table using css in such a way it does not alter the html table. When I tryied it just screws up.
1
by: Chris McGarry | last post by:
Hello, I'm new to style sheets and have been fighting with browser compatibility for two days. I'm developing a image selection page (similar to Ebay where the visitor can select and enlarge 1-6...
7
by: Arthur Dent | last post by:
I am completely baffled... i cannot for the life of me get the HEIGHT style to work on a table in the new 2005-supported XHTML. I put a HEIGHT: 100% on my table so that my footer row will also show...
5
by: shanti.miller | last post by:
I've got a grid that uses paging and displays a maximum of 10 records at a time. Sometimes the fields have a lot of data in them and the datagrid takes up way too much horizontal space. I've...
9
by: PeteCresswell | last post by:
I've got something called "Reference Rates". The idea is that on a given day, we have various rates of return for various entities. e.g. Libor 3-month return, Libor 6-month return, US Treasury...
16
by: Charles A. Landemaine | last post by:
I set a table with 100% width to occupy all available space, but in IE7 it uses more than that, it uses 100% of the page width instead of 100% of the table container. Could you test the page in IE7...
3
by: iamconfused | last post by:
Hi All... I have a very simple question (atleast I hope it is). How can I make sure the table on my page always appears in the middle (vertically & horizontally)? I am using dreamweaver, it...
22
Atli
by: Atli | last post by:
Hi. I'm setting up a small photo-album-type thing, where I use PHP to set up a list of images for visitors to click through. That's all simple enough. However, I'm having a weird bug in IE8. ...
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: 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
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
0
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...

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.