473,765 Members | 2,010 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Table stretching excessively in IE

Hello all... i have a really frsutrating problem here...
This is only happening in IE (6 & 7b2), Mozilla and Netscape are both OK.

I have a top-level table with a width of 760px, so it should be 760 minimum
and stretching wider as needed to fit content (such as bound datagrids).
In the top TR/TD, i have a header table which is width of 100%, and has
three TD's. Each contains one image file, with the middle TD being set to
width 100%.
So the td should push the end TDs to as narrow as the images in them, which
works perfectly. The middle TD is giving me a problem though. If it is
empty, then everything behaves as expected, with the whole content being
760px minimum, stretching as needed.
Next i try to add an image to the middle td of the header table. I would
expect the TD to stretch bigger as needed to fit the width of the picture.
Instead it stretches wider to fit the width of the image PLUS an additional
190 pixels of just empty whitespace, which screws up the layout of my page
now.

Anyone seen this before or have an idea how to fix it? I tried putting a
style="float: <value>" on the middle image as sometimes that fixes weird
image layout problems, but it didnt help. I also tried GIFs instead of PNGs
but that was no help either.

Essentially the code looks like this:

<table width="760px">
<tr><td id="tdHeader">
<table width="100%">
<tr><td>
<img src="/images/headerLeft.png" >
</td></td>
<tr><td width="100%">
<img src="/images/headerMiddle.pn g" >
<!-- it renders an extra 190px of width right
here -->
</td></td>
<tr><td>
<img src="/images/headerRight.png " >
</td></td>
</table>
</td></td>
<tr><td id="tdContent"> </td></td>
<tr><td id="tdFooter"> </td></td>
</table>
Mar 6 '06 #1
4 1785
Hi,

Arthur Dent wrote:
Hello all... i have a really frsutrating problem here...
This is only happening in IE (6 & 7b2), Mozilla and Netscape are both OK.

I have a top-level table with a width of 760px, so it should be 760 minimum
and stretching wider as needed to fit content (such as bound datagrids).
In the top TR/TD, i have a header table which is width of 100%, and has
three TD's. Each contains one image file, with the middle TD being set to
width 100%.
So the td should push the end TDs to as narrow as the images in them, which
works perfectly. The middle TD is giving me a problem though. If it is
empty, then everything behaves as expected, with the whole content being
760px minimum, stretching as needed.
Next i try to add an image to the middle td of the header table. I would
expect the TD to stretch bigger as needed to fit the width of the picture.
Instead it stretches wider to fit the width of the image PLUS an additional
190 pixels of just empty whitespace, which screws up the layout of my page
now.

Anyone seen this before or have an idea how to fix it? I tried putting a
style="float: <value>" on the middle image as sometimes that fixes weird
image layout problems, but it didnt help. I also tried GIFs instead of PNGs
but that was no help either.

Essentially the code looks like this:

<table width="760px">
<tr><td id="tdHeader">
<table width="100%">
<tr><td>
<img src="/images/headerLeft.png" >
</td></td>
<tr><td width="100%">
<img src="/images/headerMiddle.pn g" >
<!-- it renders an extra 190px of width right
here -->
</td></td>
<tr><td>
<img src="/images/headerRight.png " >
</td></td>
</table>
</td></td>
<tr><td id="tdContent"> </td></td>
<tr><td id="tdFooter"> </td></td>
</table>


First, your table is invalid. You have a </td> too much and a </tr> too
little.

Then, I noticed strange effects when unnecessary carriage returns were
placed in a table. Try this:

<table width="760px">
<tr>
<td id="tdHeader">
<table width="100%">
<tr>
<td><img src="/images/headerLeft.png" ></td>
</tr>
<tr>
<td width="100%"><i mg src="/images/headerMiddle.pn g"></td>
</tr>
<tr>
<td><img src="/images/headerRight.png "></td>
</tr>
</table>
</td>
</tr>
<tr><td id="tdContent"> </td></tr>
<tr><td id="tdFooter"> </td></tr>
</table>

HTH,
Laurent
Mar 7 '06 #2
Oops, yah, those extra TDs were supposed to be TRs. Typo - i manually typed
that in the msg instead of copy/pasting.

I tried putting all my TD content on one line as in :

<td><img src='/images/someImage.gif'> </td>

but to no avail.... it still keeps the table wider than it needs to be by
the same approx. 190 px.
Thanks for the idea though. :) .
"Laurent Bugnion" <ga*********@bl uewin.ch> wrote in message
news:O9******** ******@TK2MSFTN GP10.phx.gbl...
Hi,

Arthur Dent wrote:
Hello all... i have a really frsutrating problem here...
This is only happening in IE (6 & 7b2), Mozilla and Netscape are both OK.

I have a top-level table with a width of 760px, so it should be 760
minimum and stretching wider as needed to fit content (such as bound
datagrids).
In the top TR/TD, i have a header table which is width of 100%, and has
three TD's. Each contains one image file, with the middle TD being set to
width 100%.
So the td should push the end TDs to as narrow as the images in them,
which works perfectly. The middle TD is giving me a problem though. If it
is empty, then everything behaves as expected, with the whole content
being 760px minimum, stretching as needed.
Next i try to add an image to the middle td of the header table. I would
expect the TD to stretch bigger as needed to fit the width of the
picture. Instead it stretches wider to fit the width of the image PLUS an
additional 190 pixels of just empty whitespace, which screws up the
layout of my page now.

Anyone seen this before or have an idea how to fix it? I tried putting a
style="float: <value>" on the middle image as sometimes that fixes weird
image layout problems, but it didnt help. I also tried GIFs instead of
PNGs but that was no help either.

Essentially the code looks like this:

<table width="760px">
<tr><td id="tdHeader">
<table width="100%">
<tr><td>
<img src="/images/headerLeft.png" >
</td></td>
<tr><td width="100%">
<img src="/images/headerMiddle.pn g" >
<!-- it renders an extra 190px of width right
here -->
</td></td>
<tr><td>
<img src="/images/headerRight.png " >
</td></td>
</table>
</td></td>
<tr><td id="tdContent"> </td></td>
<tr><td id="tdFooter"> </td></td>
</table>


First, your table is invalid. You have a </td> too much and a </tr> too
little.

Then, I noticed strange effects when unnecessary carriage returns were
placed in a table. Try this:

<table width="760px">
<tr>
<td id="tdHeader">
<table width="100%">
<tr>
<td><img src="/images/headerLeft.png" ></td>
</tr>
<tr>
<td width="100%"><i mg src="/images/headerMiddle.pn g"></td>
</tr>
<tr>
<td><img src="/images/headerRight.png "></td>
</tr>
</table>
</td>
</tr>
<tr><td id="tdContent"> </td></tr>
<tr><td id="tdFooter"> </td></tr>
</table>

HTH,
Laurent

Mar 7 '06 #3
Hi Arthur,

Arthur Dent wrote:
Oops, yah, those extra TDs were supposed to be TRs. Typo - i manually typed
that in the msg instead of copy/pasting.

I tried putting all my TD content on one line as in :

<td><img src='/images/someImage.gif'> </td>

but to no avail.... it still keeps the table wider than it needs to be by
the same approx. 190 px.
Thanks for the idea though. :) .


Can you email me the HTML/CSS code that displays the problem? If I can
reproduce it, I'll try to solve it.

Greetings,
Laurent
Mar 7 '06 #4
Instead setting the middle TD's width to 100%, try setting the end TDs'
width to 1%, and leave the middle TD's width blank. This is how I
always do it, and it works like a charm in IE.

HTH
Luke

Mar 7 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2092
by: Andre | last post by:
Hello, I was wondering how to do percentage widths for tables. I thought simply having the width="15%" would do it. I had it so that there is only one row, and three data cells. Each cell were set to 15%, 70% and 15%, table width=100%. It works fine in opera, but not in IE. Can someone please help me? The website is http://www.oregonsae.org/2004mbw/
22
4063
by: Kim Scarborough | last post by:
Say I wanted to put a couple lines of asterisks between paragraphs, and have it stretch the spaces so that it spanned 100% of the text-width, like this: * * * * * * * * Is there a way to do this in CSS? I don't want it to line break, just collapse the spacing between the stars if the window gets narrower. -- ----------------------------------------------------------------------------
1
1734
by: rwmorey | last post by:
Hi.. I have this code in my page <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tr><td width="9"><img src="topLeft.gif"></td> <td>text goes here</td> <td width="9"><img src="topRight.gif"></td> </tr> </table>
2
1697
by: Jeff | last post by:
I've been trying for days to figure out why the spacing between the rows on the left-most column of my table is screwy. Take a look here: http://mypage.iu.edu/~jbeverid/index_new.htm Right after the graphic link that says "Study Opportunities" the spacing between the graphics in the column starts to get wider and wider and I can't figure out how to fix it. I COULD create a seperate table out of the left column which would probably fix...
7
3095
by: Bernard Dhooghe | last post by:
Environment: DB2 UDB LUW 8.2 Following problem was submitted. create table t1 (c1 char(10) not null) insert into t1 values(default) This will result in (db2 command line):
14
21103
by: rsearing | last post by:
I am new to HTML and will have to beg if this is obvious, but I am trying to design a table that looks like: ******************************** *----A------*------------------------* ************------------------------* *------------*------------------------* *------------*------------------------* *----B------*------------C----------* *------------*-------------------------* ********************************
3
5541
by: James | last post by:
I am not sure whether users can access data or insert new data into tables who belong to a rebalanced table space after new containers are added? (DB2 version is 8.x) What I know is user can not insert new data into tables who belong to a rebalanced table space. Is the any way to avoid this? Thanks James
17
5844
by: Grant Kelly | last post by:
I'm wondering if it's possible within HTML markup (or possibly CSS) to specify that an HTML table's headers should be placed 'over' the cell borders rather than 'within' the cells. For example (requires monospace font): Default: +--------------------+ | H1 H2 H3 | +--------------------+
5
1322
Ali Rizwan
by: Ali Rizwan | last post by:
Hi all, I m stretching my form and i want if i stretch its position after stretching must be in middle of screen or i want to stretch centerly. Thanx >> ALI <<
0
10007
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9957
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
8832
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
7379
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
5276
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3924
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
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2806
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.