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

Fixed cell width in table does not work in IE?

Hi,
I can't get my cell widths fixed in a table in IE6. In Mozilla it
works, see http://www.xs4all.nl/~margreeh/aa.html .
It's the blue cells that remain fixed at 20pt widths in Mozilla but
not in IE. The HTML was generated with Mozilla's Composer.
Can anyone help getting this to work in IE?
Thanks already,
Bart.
Jul 20 '05 #1
4 64848
In some browsers you have to explicitly set the column widths for all
columns. It is a good idea to use both width=20 and
style="width:20px" to ensure cross-browser. Also make sure that the
total widths of all columns add up to the width of the table. When
creating a simple table with no rowspan or colspan properties, you can
set the column widths in the first row and save the extra bandwidth of
assigning it to every column in every row.

There are also many tools that will help you check your HTML both in
terms of validity and rendering in different browsers.
http://www.tranquillitas.com/resources/journals.aspx has a series of
links to testing resources that may help you.

Let me know if this doesn't solve your problem.

Don Krapohl
http://www.tranquillitas.com
eo****@hotmail.com (Bart Heinsius) wrote in message news:<f6**************************@posting.google. com>...
Hi,
I can't get my cell widths fixed in a table in IE6. In Mozilla it
works, see http://www.xs4all.nl/~margreeh/aa.html .
It's the blue cells that remain fixed at 20pt widths in Mozilla but
not in IE. The HTML was generated with Mozilla's Composer.
Can anyone help getting this to work in IE?
Thanks already,
Bart.

Jul 20 '05 #2
Don,

Thanks for your reply.

I validated my HTML through http://validator.w3.org/ and is is valid
(now it is, anyway). But the problem remains.

I don't want to explicitly set the widths of all columns because I
want all columns to best fit except the column that I set to be 20px
wide.

Any other ideas?

Cheers,
Bart.
Jul 20 '05 #3
See if you can work with this. It seems more elegant (from
http://www.htmlhelp.com/reference/ht...olgroup.html):

<TABLE SUMMARY="This table gives the character entity reference,
decimal character reference, and hexadecimal character
reference for 8-bit Latin-1 characters, as well as the
rendering of each in your browser.">
<COLGROUP>
<COLGROUP SPAN=3>
<COLGROUP SPAN=3>
<THEAD>
<TR>
<TH SCOPE=col ROWSPAN=2>Character</TH>
<TH SCOPE=col ROWSPAN=2>Entity</TH>
<TH SCOPE=col ROWSPAN=2>Decimal</TH>
<TH SCOPE=col ROWSPAN=2>Hex</TH>
<TH SCOPE=colgroup COLSPAN=3>Rendering in Your Browser</TH>
</TR>
<TR>
<TH SCOPE=col>Entity</TH>
<TH SCOPE=col>Decimal</TH>
<TH SCOPE=col>Hex</TH>
</TR>
</THEAD>
<TBODY>
<TR>
<TD SCOPE=row>non-breaking space</TD>
<TD>&amp;nbsp;</TD>
<TD>&amp;#160;</TD>
<TD>&amp;#xA0;</TD>
<TD>&nbsp;</TD>
<TD> </TD>
<TD>&#xA0;</TD>
</TR>
</TBODY>
</TABLE>

Let me know if this still doesn't work. You can also email me if you
wish.
Don Krapohl
http://www.tranquillitas.com
Website quality assurance testing
Jul 20 '05 #4
Hmm, I tried the <COLGROUP> stuff but couldn't get that right.
Then I tried the other suggestion:
<table ... style="...; table-layout: fixed">
<col>
<col>
<col width="20">
<col>

And that works! See my real-life page (a sample) on
http://www.xs4all.nl/~margreeh/indicator_details.html where I wanted
the cell width of the cells containing the graph images fixed.
Thanks,
Bart.
Jul 20 '05 #5

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

Similar topics

4
by: Philipp Lenssen | last post by:
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...
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...
6
by: Henro V | last post by:
And if there is one, is there a way to make forms that are wider? For every day on the form (first field) it needs to be followed by 52(!) datefields. I've widened the form as far as I can but I...
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...
9
by: Daniel Kabs | last post by:
Hello there again! On my quest to remove layout tables in favor of CSS controlled elements, I am faced with quite a problem. A table cell that has no explicit width attribute set usually...
0
by: anuparvathy | last post by:
Hi I am creating a website using visual studio 2005. In the design view of my asp.net page i have placed a grid view and then i have connected it to the database also. i have set the item style...
1
by: kendrick82 | last post by:
Hi, I would like to seek some advise and assistance regarding the following matter as I am new to VB.Net. I'll appreciate any helps render. I am developing a VB application using VB.Net 2003 to...
3
by: Aaron Sherman | last post by:
OK, so I'm relatively new to the world of CSS, being an old-school HTML author who used to just write out plain HTML in 1996. However, I'm trying to do the right thing here: ...
1
by: yogarajan | last post by:
hello friend this is my code TableCell c1td1 = new TableCell(); DateTime dbdate = Convert.ToDateTime(dr); string strhr = dbdate.ToString("h:mm tt"); ...
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
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,...
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
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...

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.