473,748 Members | 10,058 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Table cell width ignored in IE6

I have a site that runs in strict mode in IE6, and IE is making <td>s
for simple two-digit numbers really wide. So I want to restrict it (and
right-align it) by using <td class="number"> and .number { width: 10px;
}. In Mozilla this works, but IE ignores this. Next to adding an
invisible "0" precding one-digit numbers, what can I do to solve this?
Jul 20 '05 #1
4 19786
"Philipp Lenssen" <in**@outer-court.com> wrote:
I have a site that runs in strict mode in IE6, and IE is making <td>s
for simple two-digit numbers really wide.
As usual, a URL would be essential, since this surely depends on various
ingredients on the page or associated with the page.
So I want to restrict it (and
right-align it) by using <td class="number"> and .number { width: 10px;
}. In Mozilla this works, but IE ignores this.


Why do you set the width in pixels? If it "worked", it could cause serious
trouble.

There's no way to say "two characters wide" in CSS. There's even no
guarantee that all digits have the same width, but this happens to be the
case in all - or at least almost all - fonts. But none of the CSS units
corresponds to the width of a character. The ex unit can be used as a coarse
guess, but for safety, I would use something like width: 2.5ex for a field
that contains two digits.

On the other hand, browsers may ignore anything you say about widths. You
can make most graphic browsers honor your widths for table cells if you set
table-layout: fixed for the table, telling that the browser should apply a
fixed algorithm for allocating the widths, using the _first_ line of the
table as the basis. But then you open a can of worms, especially if you have
used the px unit - content that doesn't fit will (by default) be omitted,
procrustinated.

So I think you should first analyze what causes the problem. Normally a
browser allocates just the needed width for a column. But if you set e.g.
width: 100% for the entire table, then the browser has a problem, and will
probably make it your problem too.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Jul 20 '05 #2
Jukka K. Korpela wrote:
"Philipp Lenssen" <in**@outer-court.com> wrote:
I have a site that runs in strict mode in IE6, and IE is making
<td>s for simple two-digit numbers really wide.
As usual, a URL would be essential, since this surely depends on
various ingredients on the page or associated with the page.


The page is not yet intended for publication. I'm working on a client
and cannot show the URL (it's password-protected anyway at the moment).

There's no way to say "two characters wide" in CSS. There's even no
guarantee that all digits have the same width, but this happens to be
the case in all - or at least almost all - fonts. But none of the CSS
units corresponds to the width of a character. The ex unit can be
used as a coarse guess, but for safety, I would use something like
width: 2.5ex for a field that contains two digits.

Sounds good.
You can make most graphic browsers honor your widths for table cells
if you set table-layout: fixed for the table, telling that the
browser should apply a fixed algorithm for allocating the widths,
using the first line of the table as the basis. But then you open a
can of worms, especially if you have used the px unit - content that
doesn't fit will (by default) be omitted, procrustinated.
Exactly, I don't want to open that can. I played around with fixed
table-layout and I find it really annoying.

So I think you should first analyze what causes the problem. Normally
a browser allocates just the needed width for a column. But if you
set e.g. width: 100% for the entire table, then the browser has a
problem, and will probably make it your problem too.


Yes, currently the width is set a defined pixel value, like 615px. This
causes IExplorer to do some strange things. Maybe I can just get rid of
the width in this case. In others, I can't, because several pages
contain the table of a similar structure, but single cells carry the
same meaning and should look alike. But in this case I might just do
that, let the width be automatically adjusted to the content. Will see
if the art director or client likes it though!
Jul 20 '05 #3
Philipp Lenssen wrote:
The page is not yet intended for publication. I'm working on a client
and cannot show the URL (it's password-protected anyway at the moment).


You could give us the source code or a link to the source code. We don't
need images to check if it is correct ;-)

--
Anne van Kesteren
<http://www.annevankest eren.nl/>
Jul 20 '05 #4
Philipp Lenssen wrote:
Jukka K. Korpela wrote:


So I think you should first analyze what causes the problem.
Normally a browser allocates just the needed width for a column.
But if you set e.g. width: 100% for the entire table, then the
browser has a problem, and will probably make it your problem too.


Yes, currently the width is set a defined pixel value, like 615px.
This causes IExplorer to do some strange things. Maybe I can just get
rid of the width in this case. In others, I can't, because several
pages contain the table of a similar structure, but single cells
carry the same meaning and should look alike. But in this case I
might just do that, let the width be automatically adjusted to the
content. Will see if the art director or client likes it though!


OK, I'm afraid the auto-width isn't acceptable from a layout POV. Will
have to figure out something else... actually, like I said, Mozilla is
doing just fine -- I have some cells which have an auto-width, and some
which have a fixed width, so why shouldn't the browser be able to
figure out to have the auto-width cells occupy what's left over of the
width?
Jul 20 '05 #5

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

Similar topics

2
7121
by: LC's No-Spam Newsreading account | last post by:
I have a form arranged in a table (you can see an example in the page http://cosmos.mi.iasf.cnr.it/~lssadmin/Website/LSS/Help/query.html) The table is on three columns but has a structure like this. The part I'm concerned with is the cell FFFFF which contains a multiple <SELECT> list of <OPTION>s. As you can see the first two rows span more than one column (if this has any importance). What I want is to constrain FFFFF not to exceed a...
5
30215
by: Ivo | last post by:
Consider a table with a number of rows, each containing a short text (label) on the left and an input control on the right. Some inputs are of type text and others of type checkbox. I would like the cells with the checkboxes to be as narrow as possible (square) but in this table the "width=10" bit seems to get ignored: <table border="1"> <tr> <td>some text</td> <td colspan="2"><input type="text"></td>
1
7119
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> #treecontainer {
3
2828
by: RBalbat | last post by:
Hello all, I have encountered an unexpected problem where if I render a table (in IE or Opera) and there are cells that contains URLs with long query strings, even though I specify the table element with the width attribute set as 90%, when I render the document, it spans way off the right side of the screen. For some reason, having a long query string in the cell does some funcky stuff. Does anyone know how to *force* the table to only...
1
3550
by: Thanks | last post by:
I have a routine that is called on Page_Init. It retrieves folder records from a database which I display as Link Buttons in a table cell. I set the table cell's bgcolor to a default color (say black for example). I am dynamically creating the LinkButton controls and adding them into the table cell and I've also hooked up an event handler for each LinkButton's Click event. This all works fine. Now in the Link Button's Click event...
1
12301
by: Jeronimo Bertran | last post by:
I am creating a table and inserting an iframe inside a cell for which the width depends on the screen size. The table has 7 columns and the fourth column is resized depeding on the screen size... here is my complete definition. <table style="HEIGHT: 472px" cellSpacing="0" cellPadding="0" width="100%" border="0"> <tr height="1">
2
4136
by: Dot net work | last post by:
Hello. Is it possible to build up a dynamic server side table, and specify the column widths as percentages? I've tried this: Set the table width to 100%, then: FirstColumn.Width = New Unit(50, UnitType.Percentage) SecondColumn.Width = New Unit(30, UnitType.Percentage) ThirdColumn.Width = New Unit(20, UnitType.Percentage)
0
1512
by: Thomas Scheiderich | last post by:
I have a table that has 3 image slices. The middle slice changes size based on size of browser window. This works great. My client wants the date to show over the image on the right. So what I did was cut off the top part of the image (which is just a solid color and I can handle by making the background-color of the cell this color). I then use a asp line to display the date, which also works. Here is the original table setup for...
117
18555
by: phil-news-nospam | last post by:
Is there really any advantage to using DIV elements with float style properies, vs. the old method of TABLE and TR and TD? I'm finding that by using DIV, it still involves the same number of elements in the HTML to get everything just right. When you consider the class attribute on the DIV elements, there's not much size savings anymore for using DIV. There are other disadvantages to not using TABLE/TR/TD, such as the lack of ability...
0
8823
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9530
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9363
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
9312
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
8237
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
6793
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
6073
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4593
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...
1
3300
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

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.