Link to home
Start Free TrialLog in
Avatar of Mick87
Mick87Flag for United States of America

asked on

Table and Table Cell Widths

I need to format a table so that it is exactly 1250px where the individual columns are specific width. If I set the width of the parent table tag to 1250 and each of the child td tags so that the sum of the td tags is 1250 - shouldn't the IE6 respect the explicit widths?

I've got a situation where IE6 is altering the widths of the cells and I can't figure out why.

Any ideas.

I'll post code as soon as I have it split out its a part of a ASP.NET page and will take some time.
Avatar of theras2000
theras2000
Flag of United States of America image

Is the table mostly empty?  If my memory serves me, you need something inside all the cells of at least 1 row.  I think even just a   will do.  I haven't coded html in a while, but I seem to remember something like that.
Avatar of gamebits
2 things with table

1) IE will not display the cell if it's empty but Firefox will
2) If the object in a cell is bigger than the cell (like an image) the cell will expand to accomodate the object, regardless of the set width.
Avatar of Mick87

ASKER

I'm actually reworking the markup to see if that helps. The project is a telephone directory that includes the ability to see a person's assistants. The assistant information is in a nested table. For aesthetic considerations, I want the information to appear seamlessly to the user where the assistant information appears as just another row(s) below the primary person. The information can be hidden/shown on demand. Moving one step out, the directory information resides within a fixed height div that scrolls on overflow which then led to my placing the header information outside of the div - the result being what appears to be a scrollable table.
Avatar of Mick87

ASKER

I think that the problem was two fold - first, there was a hidden column which I did not take into account on a table cell that I set to span all columns - the colspan was off by one. Second, the formatting isn't consistent because there is a nested repeater that conditionally adds a table. Since the asp:repeater does not contain any template if there's no data things the lack of it was jacking things up. I realize that doesn't help anyone else out too much as I haven't given any examples, but the time it would take to present one isn't worth trying it given that the time could be spent trying to fix it.
ASKER CERTIFIED SOLUTION
Avatar of Mick87
Mick87
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
the way I handle this kind of situation usualy is by writing my code in such a way that I always have something to display or at least have a hidden place holder, kind of an image saying there is no image to display, this way I can "stabilise" the table by having consistent object within the cell.

if there is data display it
if not display the default value.
Also Firefox has a add on called web developer that you can download it allow you to show the cells and/or the table without having to actually set a border for each one I found it very usefull to debug tables issues.