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

how to expand content for a TD to cover 100% of its height (IE)

I have a table with one TR and two TDs, one of the TDs has more content (i mean with content: other sub tables) than the other one, this results the following:

the TD with the little content stay shrinked (its content stay as is, not expanded) and this happens in case of IE only, firefox and google chrome are fine, both of FF and chrome do expand the smaller TD content to fill 100% of that TD's height, my question is how to expand the content of the smaller TD to fill 100% of its height ?

p.s. I tried to put a DIV with height: 100%; inside the smaller TD but didn't work ...and this is a dynamic code, means that both TDs are changable with their content according to some criteria ...
look at both screenshots:





thank you so much in advance
Jul 29 '10 #1
3 3516
JKing
1,206 Expert 1GB
Could you post the code that goes along with it?
Jul 29 '10 #2
it's a huge PHP dynamic code ... I used now a method to adjust height on IE using a small piece of javascript code, do you encourage to use javascript in such case ?

the script is only one line :

document.getElementById('course_cell_table0').styl e.height = document.getElementById('course_cell_0').clientHei ght + 'px';
Jul 29 '10 #3
johny10151981
1,059 1GB
This thing can be achievable by clever cascading of table and CSS no javascript is required at all. take a look at the sample code below
Expand|Select|Wrap|Line Numbers
  1. <HTML>
  2. <BODY>
  3. <TABLE>
  4.  <TR>
  5.   <td valign=top>
  6.    <table height=100%>
  7.     <tr>
  8.      <td>name</td>
  9.      <td>johny</td>
  10.     </tr>
  11.     <tr>
  12.      <td>name</td>
  13.      <td>johny</td>
  14.     </tr>
  15.     <tr>
  16.      <td>name</td>
  17.      <td>johny</td>
  18.     </tr>
  19.     <tr>
  20.      <td>name</td>
  21.      <td>johny</td>
  22.     </tr>
  23.    </table>
  24.   </td>
  25.   <td>
  26.    <table height=100%>
  27.     <tr>
  28.      <td>name</td>
  29.      <td>johny</td>
  30.     </tr>
  31.     <tr>
  32.      <td>name</td>
  33.      <td>johny</td>
  34.     </tr>
  35.     <tr>
  36.      <td>name</td>
  37.      <td>johny</td>
  38.     </tr>
  39.     <tr>
  40.      <td>name</td>
  41.      <td>johny</td>
  42.     </tr>
  43.     <tr>
  44.      <td>name</td>
  45.      <td>johny</td>
  46.     </tr>
  47.     <tr>
  48.      <td>name</td>
  49.      <td>johny</td>
  50.     </tr>
  51.    </table>
  52.   </td>
  53.  </TR>
  54.  <tr>
  55.   <td bgcolor="gray">back </td>
  56.   <td bgcolor="gray">back</td>
  57.  </tr>
  58. </TABLE>
  59. </body>
  60. </HTML>
The above code is nothing compared to your requirement. But I guess i will give you a pretty good idea.

By the way why dont you keep your application logic and presentation logic in separate file? this is great for bug testing and fixing.

Best Regards,
Johny
Aug 1 '10 #4

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

Similar topics

1
by: M2 | last post by:
Hi All, I am using a div with a 100% height (within a document with body with body and html set to 100% too) as a method of getting some colored bars down the side. This seems to work just fine in...
11
by: Not4u | last post by:
Hello, I have a problem with CSS code. I want to have one menu column with a fixed width and a 100% height and the rest of the page for content. ---------------- |.|.|<--100%-->|...
0
by: Robert | last post by:
Hi, I am having some difficulty to have two DIVs or cells on top of eachother that take (at least) 100% of the browser height. First I tried to use DIVs and set them HTML and BODY height to...
1
by: joshthomas99 | last post by:
Hello, Yes, I've spent hours reading through all the old postings and searched the net - but couldnt find a solution to the 100% height problem with nested divs. Basically I want the first...
0
by: JimmyHoffa | last post by:
Can anyone help me get I.E 6 to show an absolute positioned div with height as 100% to actually be 100% height of its containing div (which also has height set to 100%)? I.E 7 and Firefox both...
0
by: sannymak | last post by:
Hello All, I have some problems making the columns 100% and forcing the footer at the bottom. Please refer to the code below and let me know a solution: HTML CODE: <!DOCTYPE html PUBLIC...
3
by: guaranine | last post by:
Hi, I've got the 100% height for the whole table working. What is really confusing me is how to make the TR tag in which the content is work properly in IE. If I do not explicitly specify its...
4
by: Christopera | last post by:
Hello, I have built a site that uses two divs, one verticle, and one horizontal as graphic style for the ite. The problem I am having is that if the browser is resized very small the divs are...
6
by: msoliver | last post by:
I'm trying to figure out why the following creates a vertical scroll bar. Browser is IE 7 - using XHTML 1.0. I expand html and body to height of 100% and then I want to put a border around the...
1
ilya Kraft
by: ilya Kraft | last post by:
Hello, I have this problem: have my div with wrapper id, want it to expand width, height 100%, but for some reason it is not expanding in height. it contains image that i want to use as a top...
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: 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
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...
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
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...
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,...

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.