Click to See Complete Forum and Search --> : [RESOLVED] Table cells are wider in Internet Explorer


drennan
07-17-2008, 08:56 PM
I've created a table-based website in DW and have been previewing it in safari and firefox. I've just uploaded it and tested on a PC and Internet Explorer is displaying the cells much wider than other browsers. This throws out the alignment of the whole site. Does anyone know why this is happening and how to force the cells to be a specific width? The width setting in the property inspector doesn't make any difference. thanks

felgall
07-17-2008, 10:43 PM
When you define tables you can specify the minimum width for cells. If the content needs more than that minimum then the table will expand to fit. The whole idea of a table is that it adjusts its size based on what it contains. There is no way to force the table to a specific size because if your visitor increases the text in their browser your table must be able to adjust to fit the larger text size or they will end up only seeing part of the content.

The rerason why it is a different size in IE is either because the margins and padding are not being set in the stylesheet and therefore the default for the particular browser is being used AND/OR you have the font size set differently in the different browsers either by having forgotten to specify it in your author stylesheet or by attaching a user stylesheet in a browser that overrides the author setting.

drennan
07-17-2008, 10:49 PM
Thanks. I worked out what's causing it but I dunno how to fix it. I've got text areas inserted on the bottom row of my table where cell data totals up using javascript. These are set to have a character width of 5 to display the data properly. In safari and firefox, they look fine but in IE, they are really wide so the table becomes a lot bigger. I changed one of the text fields to 2 characters so its tiny, but in IE this looks like 5 characters would in safari and displays more than 2 characters. The font being displayed is still very small in IE so I dont think that would be increasing the width.

Centauri
07-18-2008, 02:17 AM
Try setting the widths of the text areas in ems via css.

drennan
07-18-2008, 11:04 AM
thanks. do you know how i'd do this in dreamweaver? I've looked on google but can't see anything relating to it.

Centauri
07-18-2008, 11:47 AM
textarea {
width: 4em;
overflow: hidden;
height: 1.4em;
}

drennan
07-18-2008, 12:26 PM
Fantastic. You don't know how many posts i've made to other forums trying to get this solved. Thanks mate.