473,698 Members | 2,747 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 64869
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:20 px" 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.go ogle.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>Chara cter</TH>
<TH SCOPE=col ROWSPAN=2>Entit y</TH>
<TH SCOPE=col ROWSPAN=2>Decim al</TH>
<TH SCOPE=col ROWSPAN=2>Hex</TH>
<TH SCOPE=colgroup COLSPAN=3>Rende ring in Your Browser</TH>
</TR>
<TR>
<TH SCOPE=col>Entit y</TH>
<TH SCOPE=col>Decim al</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
19782
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 .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?
4
1926
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 onmouseover="alert(this.width);"> but I don't want to require any user action.
6
16121
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 lack space................ Any solutions? TIA Henro
4
2768
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 remainder of the width available. In ASP.NET the 2nd cell (when set to 100%) is 500 pixels wide (hence overlapping the image in row 1), wheras in classic ASP the cell would have a width of 500-22 = 478 pixels (thus filling the remainder of the...
9
2608
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 adapts its width to accommodate the content nicely. This is not the case when the content contains floats. I guess floats do not contribute to the table cell width as floated elements are taken out
0
1237
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 wrap property to false in my source code for every column.so in my output i get my data in a single line and the cell width adjusts according to it.but i want my cell width to be small and data to appear in a single line, meaning if i have a big data...
1
3174
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 extract data from text files and import it into datatable. The format of the text file is fixed length/width. Eg. http://img174.imageshack.us/img174/8457/untitledpp4.jpg I am having trouble to do so as I am not sure how to start. I had done...
3
1614
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: http://wowstreet.ajs.com/wowstreet?report=stable and have hit a snag. I used a trick that I found on Wikipedia to re- size text elements and place an image after them (in this case the coin types in the prices). Problem is that in Firefox only, the column remains...
1
4960
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"); c1td1.Text ="&nbsp;"+ strhr;
0
8683
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9170
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
9031
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...
0
7741
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
6531
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
5867
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
4372
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
4624
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2007
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.