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

Need help getting table cells to display correctly in Firefox.

I have a single row table with fixed dimensioned cells nested inside a
fixed dimensioned div, which has overflow: hidden. The div's dimensions
are such that It should only display the first two table cells.

This all renders correctly in MSIE 6.x, but doesn't in Firefox. In
Firefox, the cell widths are reduced so that all the cells are displayed
within the div frame.

I've played around with this: commenting out css properties to see if i
could figure out which one was causing the problem. When I commented out
the width on the div, the cells were rendered with the correct width,
but of course then all the cells were displayed, which I don't want.

How do I get the div to only display the first two table cells while
maintaining the correct width for these cells?

I would appreciate if someone would give me any help or pointers on
this. My code is below.
Regards,
N. Demos

--------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<HTML>
<HEAD>
<META name="Generator" content="TextPad 4.7">
<META http-equiv="Content-Type" content="text/html; charset=utf-8">

<TITLE></TITLE>
<STYLE type="text/css">
BODY {
color: #FFFFFF;
background-color: #000000;
text-align: center;
box-sizing: border-box;
}
DIV.tblDiv {
position: relative;
left: 0;
top: 0;
overflow: hidden;

/* !!!Note: If width is commented out, then the table cells assumes the
width specified in it's rule. Otherwise the width style for the cells is
not applied */
width: 348px;
height: 170px;
border-width: 3px;
border-color: #A0A0A0;
border-style: ridge;
background-color: #FFA0A0;
margin-bottom: 1em;
margin-left: auto;
margin-right: auto;
text-align: center;
}
TABLE.tblTest {
position: relative;
border-style: ridge;
border-color: #B0B0B0;
border-width: 0;
background-color: #A0A0FF;
border-collapse: collapse;
table-layout: fixed;
}
.tblTest TR {
vertical-align: middle;
}
TD.imgClass {
margin: 0;
text-align: center;
width: 170px;
height: 170px;
min-width: 170px;
min-height: 170px;
border-width: 0;
border-right-width: 2px;
border-right-style: ridge;
border-right-color: #B0B0B0;
padding: auto;
}
</STYLE>
</HEAD>

<BODY>
<DIV class="tblDiv">
<TABLE class="tblTest">
<TBODY>
<TR>
<TD class="imgClass">Cell 1</TD>
<TD class="imgClass">Cell 2</TD>
<TD class="imgClass">Cell 3</TD>
<TD class="imgClass">Cell 4</TD>
</TR>
</TBODY>
</TABLE>
</DIV>

</BODY>
</HTML>

--
Change "seven" to a digit to email me.
Jul 21 '05 #1
3 5891
N. Demos wrote:
I have a single row table with fixed dimensioned cells nested inside a
fixed dimensioned div, which has overflow: hidden. The div's dimensions
are such that It should only display the first two table cells.

This all renders correctly in MSIE 6.x, but doesn't in Firefox. In
Firefox, the cell widths are reduced so that all the cells are displayed
within the div frame.

I've played around with this: commenting out css properties to see if i
could figure out which one was causing the problem. When I commented out
the width on the div, the cells were rendered with the correct width,
but of course then all the cells were displayed, which I don't want.

How do I get the div to only display the first two table cells while
maintaining the correct width for these cells?

I would appreciate if someone would give me any help or pointers on
this. My code is below.
Regards,
N. Demos
[...] BODY {
color: #FFFFFF;
background-color: #000000;
text-align: center;
box-sizing: border-box;
The CSS validator doesn't like 'box-sizing'.
}
[...]
TABLE.tblTest {
position: relative;

Add a width to the table:

/* position: relative; */
width: 680px;
border-style: ridge;
border-color: #B0B0B0;
border-width: 0;
background-color: #A0A0FF;
border-collapse: collapse;
table-layout: fixed;
}
.tblTest TR {
vertical-align: middle;
}
TD.imgClass {
margin: 0;
text-align: center;
width: 170px;
height: 170px;
min-width: 170px;
min-height: 170px;
border-width: 0;
border-right-width: 2px;
border-right-style: ridge;
border-right-color: #B0B0B0;
padding: auto;
The CSS validator didn't like - padding: auto - here
}

[...]
--
Rob
Jul 21 '05 #2
RobG wrote:
N. Demos wrote:
I have a single row table with fixed dimensioned cells nested inside a
fixed dimensioned div, which has overflow: hidden. The div's
dimensions are such that It should only display the first two table
cells.

This all renders correctly in MSIE 6.x, but doesn't in Firefox. In
Firefox, the cell widths are reduced so that all the cells are
displayed within the div frame.

I've played around with this: commenting out css properties to see if
i could figure out which one was causing the problem. When I commented
out the width on the div, the cells were rendered with the correct
width, but of course then all the cells were displayed, which I don't
want.

How do I get the div to only display the first two table cells while
maintaining the correct width for these cells?

I would appreciate if someone would give me any help or pointers on
this. My code is below.
Regards,
N. Demos
[...]


Rob,
Thank you for taking the time to look at this and replying.
BODY {
color: #FFFFFF;
background-color: #000000;
text-align: center;
box-sizing: border-box;

The CSS validator doesn't like 'box-sizing'.

Hmm.. really? I'll have to look into this.
}

[...]
TABLE.tblTest {
position: relative;


Add a width to the table:


Yes, I discovered this. This seems to have been my main problem, in
terms of what I was trying to achieve. It's apparently necessary to add
a numeric width to a table when you want to hide part of the table (with
fixed width cells or columns) inside a parent element with overflow set
to hidden. The interesting part is that any numeric width will work,
even zero, since what is used to determine the table's width is the
cell/column width. If no table width is specified, then the table is
fitted inside the containing parent's width.

TD.imgClass {
[...]
The CSS validator didn't like - padding: auto - here

}


[...]


Thanks and Regards,
N. Demos
--
Change "seven" to a digit to email me.
Jul 21 '05 #3
N. Demos:
RobG wrote:
The CSS validator doesn't like 'box-sizing'.


Hmm.. really? I'll have to look into this.


'box-sizing' is a property from CSS3 UI, which is already in CR status,
therefore awaiting implementation. It was really stupid IMO to put it
there and not into CSS3 Box. Tantek Çelik's, the editor of CSS3 UI,
excuse on www-style was, quoting Ian Hickson, that they, the CSS WG,
wanted to get it into a CR spec as soon as possible and later move it
into the module it really belongs to. I never understood, why they
didn't just put it into CSS 2.1 then. After all, unlike some other
additions or changes, many browsers (IE5/Mac and Opera, Mozilla with
prefix) already support it (and it's a much cleaner approach than
"doctype switching").

<http://www.w3.org/TR/css3-ui/#box-sizing>
<http://www.w3.org/TR/css3-box/#box-sizing>
<http://lists.w3.org/Archives/Public/www-style/2003Jul/0037.html>
<http://lists.w3.org/Archives/Public/www-style/2003Nov/0068.html>
Jul 21 '05 #4

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

Similar topics

2
by: Knoxy | last post by:
Hello, I've noticed one or two people post on this before but nobody seems to have replied so raising the issue again... is this a known IE6 CSS bug? I have placed the following in my...
0
by: N. Demos | last post by:
I have a single row table with fixed dimensioned cells nested inside a fixed dimensioned div, which has overflow: hidden. The div's dimensions are such that It should only display the first two...
31
by: Arthur Shapiro | last post by:
I'm the webmaster for a recreational organization. As part of one page of the site, I have an HTML "Calendar at a Glance" of the organization's events for the month. It's a simple table of a...
2
by: Mike | last post by:
My page populates a table with a list of names and other information from a JavaScript object. I receive changes (adds, change & delete) to that list, convert it into a JavaScript object. I do...
14
by: lance | last post by:
Hi, I am a JS newbie. Hopefully the answer to my question is not trivial. I have written a simple webpage that presents a table. A JS function allows the viewer to click on a cell and each...
6
by: Bill | last post by:
Hi All, New to the whole .Net and C# thing but trying. In classic asp this was simple to fill a table with dynamic content and hyperlinks. Here is an example of what I am trying to do in classic...
5
by: rn5a | last post by:
A Web Form has a TextBox within a DataGrid wherein users are expected to enter only whole numbers. It should be validated so that the TextBox doesn't remain blank or any non-numeric data is...
1
by: bumpy | last post by:
I wrote this pretty slick DHTML table that lets you add/remove rows and show/hide columns on the fly. It works perfectly in IE7, but it doesn't behave in Firefox 2.0.0.4. You can see it in action...
2
by: cluce | last post by:
i have a table sorting feature on my website that works everywhere else except in firefox. but the example code does work in firefox. this has me stumped. The problem is the links in the table...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
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.