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

Browsers do not obey width for table cell.

Hello,

I have a cell that I making 200px wide with a style sheet. I am
setting the padding-left to 40px and the padding-right to 0px. I have
160x3 px gif in the cell. There should be no space between the gif and
the right side of the cell (40 + 160 = 200).

http://www.netadvies.nl/test/index.html
http://www.netadvies.nl/test/layout.css
http://www.netadvies.nl/test/160x3.gif

However, both FF and IE do create space at the right, they are making
the cell wider than 200px.

I cannot figure out why they do this and how to stop them from doing
this.

Any help is appreciated.
Louis.
Aug 14 '06 #1
3 2330
On Mon, 14 Aug 2006 10:44:33 +0200, Louis. <wrote:
However, both FF and IE do create space at the right, they are making
the cell wider than 200px.

I cannot figure out why they do this and how to stop them from doing
this.
Have you tried putting the entire TD on one line in index.html ? I find
that the white space (e.g. carriage returns) can cause problems. If
this helps and you don't like the source formatting, try :

<td width="200" align="left" valign="top" id="leftnavigation"
>LEFTNAV<br
<img src="160x3.gif" alt="" width="160" height="3" hspace="0"
vspace="0" border="0"
></td>
This deletes all white space between elements.

>
Any help is appreciated.
Louis.
--
Steven
Aug 14 '06 #2
Louis. <wrote:
>I have a cell that I making 200px wide with a style sheet. I am
setting the padding-left to 40px and the padding-right to 0px. I have
160x3 px gif in the cell. There should be no space between the gif and
the right side of the cell (40 + 160 = 200).
Under the W3C box model rules horizontal padding is added to the width
of the table cell (200 + 40 = 240).
>http://www.netadvies.nl/test/index.html
Btw, you trigger quirks mode rendering. All bets are off on what you'll
get in quirks mode, I suggest you at least use a transitional doctype
that triggers "Standards" mode, or better: switch to Strict coding and
doctype.

--
Spartanicus
Aug 14 '06 #3
On Mon, 14 Aug 2006 10:21:16 +0100, Spartanicus
<in*****@invalid.invalidwrote:
>Louis. <wrote:
>>I have a cell that I making 200px wide with a style sheet. I am
setting the padding-left to 40px and the padding-right to 0px. I have
160x3 px gif in the cell. There should be no space between the gif and
the right side of the cell (40 + 160 = 200).

Under the W3C box model rules horizontal padding is added to the width
of the table cell (200 + 40 = 240).
>>http://www.netadvies.nl/test/index.html

Btw, you trigger quirks mode rendering. All bets are off on what you'll
get in quirks mode, I suggest you at least use a transitional doctype
that triggers "Standards" mode, or better: switch to Strict coding and
doctype.

Hello Spartanicus,

Thank you very much. I have been fighting with this all morning. You
showed me the way it works. It is working exactly as I wish now.
Suppose you want to have a box. It should be 160 pixels wide and you
want an extra 20 pixels between the box borders and the content.

<div id="box">content box</div>

WRONG:
=====
#box {
width: 158px;
border: 1px solid #ABC;
padding: 20px 20px 20px 20px;
}

To accomodate the padding the box is expanded and becomes larger than
160 pixels.
RIGHT:
====
#box {
width: 118px;
border: 1px solid #ABC;
padding: 20px 20px 20px 20px;
}

This box becomes 160 pixels wide.
Aug 14 '06 #4

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

Similar topics

9
by: johkar | last post by:
I only have IE 6 and dial-up. Can you help me determine which browsers support this code? Thanks, John <html> <head> <title>Fixed Table Headers</title> <script language="JavaScript"...
23
by: MattB | last post by:
Hello please help, I have a table cell with a div in it. The div has a width of 300px. but when it is rendered it puts extra space into the table cell. Here's the style <style>...
4
by: Lan Vuong | last post by:
Hi everyone, I'm trying to retrieve the width of a cell as the table is being dynamically created and add it to a total. I can get the width from an eventhandler such as: <td...
2
by: 23s | last post by:
Given the following table structure, <table width=100%> <tr> <td>static</td> <td>static</td> <td>variable</td> <td>static</td> </tr> </table>
4
by: Alex Meier | last post by:
I have the following problem: I need a simple, tabular layout in a webshop. - left column: navigation column with approx. 170px width - right column: content area the goal: the left column...
2
by: steventhrasher42 | last post by:
I can't figure out a way to possibly make this work in HTML. I have a table embedded in another table, with the inner table spanning a few columns. I would like for the outer table to span the...
4
by: Hiwj | last post by:
I am having a problem with a cell in a table in ASP.NET which used to work OK in classic ASP. I have one cell in a row where the width should be 22 pixels and the other cell should take up the...
50
by: Shadow Lynx | last post by:
Consider this simple HTML: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 STRICT//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head>...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
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
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
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
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.