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

need a div to grow automatically as the table inside it

Hi guys,

i only know basic css mainly the formatting part....

i want to create a side panel for my website that looks like a small window that has a blue header and blue borders and slightly curved bottam border...i did this by making images and setting them as backbround images fo the respective divs

here my code

Expand|Select|Wrap|Line Numbers
  1.  <div id="docket">
  2.             <div id="header">
  3.             </div>
  4.             <div id="left">
  5.             </div>
  6.             <div id="middle">
  7.             </div>
  8.             <div id="right">
  9.             </div>
  10.             <div id="bottam">
  11.             </div>
  12.         </div>
  13.  
and in the css i have defined these

Expand|Select|Wrap|Line Numbers
  1. #docket
  2. {
  3.     width:189px;
  4.     height:auto;
  5. }
  6. #header
  7. {
  8.     width:100%;
  9.     background:url(images/STRIP01.jpg) no-repeat;
  10.     height:24px;
  11.  
  12. }
  13. #left
  14. {
  15.     float:left;
  16.     width:1%;
  17.     background:url(images/STRIP0W2.jpg) no-repeat;
  18.     height:80px;
  19.  
  20.  
  21. }
  22. #middle
  23. {
  24.     float:left;
  25.     width:98%;
  26.     background:url(images/popBG.jpg);
  27.     height:80px;
  28. }
  29. #right
  30. {
  31.     float:left;
  32.     width:1%;
  33.     background:url(images/STRIP0W2.jpg) no-repeat;
  34.     height:80px;
  35. }
  36. #bottam
  37. {
  38. clear:both;
  39. width:100%;
  40. background:url(images/STRIP0W3.jpg) no-repeat;
  41. height:7px;
  42. }
  43.  
in the main div i will place a table that has say 6 or 7 rows with various options for the user such as profile visit,messsages,videos,pics etc...now sometimes i want to show or hide some rows based on privacy settings and i want it to resize automatically......

i an earlier post i learnt that float overflows its container but the rest was pretty cryptic to me.....tried using auto but that diidnt work

you will notice that the left,main,and right have fixed widths of 80px to incorporate six rows...so is there any way to do this???

it works pretty well except the fact that it doesnt resize automatically
May 5 '09 #1
4 4996
Hamayun Khan
106 100+
Place your table inside the div tag having id=middle and change the height and width to 100%

Expand|Select|Wrap|Line Numbers
  1. <div id="docket"> 
  2.             <div id="header"> 
  3.             </div> 
  4.             <div id="left"> 
  5.             </div> 
  6.             <div id="middle">
  7. <table><tr><td>&nbsp;</td></tr></table> 
  8.             </div> 
  9.             <div id="right"> 
  10.             </div> 
  11.             <div id="bottam"> 
  12.             </div> 
  13.         </div> 
  14.  
May 5 '09 #2
thanks for replying....

already treid that...it does cause the div to expand as neccessay...but then the left and right lines disapper and dont show...and all i get is a box with the header and the content and the bottam....no side images....which i think means that the left and right div are being over riden.

they only have a width of 1%

plz can anyone tell me how to do it
May 5 '09 #3
Hamayun Khan
106 100+
why don't you use table instead of divs.
May 5 '09 #4
acoder
16,027 Expert Mod 8TB
...because tables shouldn't be used for layout.
May 7 '09 #5

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

Similar topics

1
by: LizP | last post by:
We're using SQL2000 on Windows 2000 Server, but this is a problem we've had on one particular database since SQL7 on NT4. The database in question is set to autogrow by 10% (currently sitting at...
7
by: Bing Du | last post by:
Greetings, The following shows how the Properties of a database look like: Data Files: File Name: student_dat Location: e:\data\MSSQL\Data\student.mdf Space allocated (MB): 62...
2
by: Stewart | last post by:
Originally posted in comp.lang.javascript: Newsgroups: comp.lang.javascript From: "Stewart" Date: 23 Aug 2005 02:50:04 -0700 Local: Tues, Aug 23 2005 10:50 am Subject: FireFox, RemoveChild,...
2
by: Markus Neifer | last post by:
Hi, could somebody please explain why the following statement consumes six extents: CREATE TABLE T1 (C1 INT, C2 BLOB(1K)) IN TS1 I see one extent for the extent map and one extend for data...
48
by: phillip.s.powell | last post by:
MySQL 3.23.58 - 4.0.17 (yep, several database server instances, don't ask) I have database Spring with table Students I have database Summer with table Students I am tasked to produce a...
3
by: Lee | last post by:
Hello all, I have a question about Divs. It is possible to have a Div grow in length in response to a control such as a Table or Gridview growing inside of it? -- Warm Regards, Lee
8
by: Lynx101 | last post by:
Hi, hope anyone can help with this query. Background: Subform datasheet link to a form to store updates on projects. Query: I have a datasheet where one of the field is a memo field. When...
0
by: xadrian | last post by:
Hi, I'm trying to put together a query that will order entries in a table by the rating values which decay over time. I'm not too well versed in the intricacies of Postgres, or complex queries,...
5
by: Stepheno | last post by:
Hi, I am a recently converted Iseries (AS/400) RPG programmer trying to learn HTML/CSS/JavsScript all at the same time (not fun). My problem deals mostly with CSS. I will be reveiving a table,...
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
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...
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
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,...

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.