• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

HTML Question

Scootin159

Diamond Member
What is an easy way to make a table cell ( <td> ) be forced to be 100% wide? For some reason <td width="100%"> asldifajsdf </td> is only working in IE for me & not mozilia.
 
try style sheets. i dunno if mozilla will read em though. you can look up table style sheets at webmonkey.com
 
i don't understand why they would interpret different, they both read HTML and turn it into a usable product right? why would they not make the same thing?

my site has terrible problems with table column width when viewed in mozilla, because the table it set to 100% width, it shows the set sizes of the columns correctly but the last column will be just huge and there is a scroll bar along the bottom to view the next few thousand pixels width of blank column.
 
more often than not, relative table sizing is something you should steer away from. Different browsers will react differently, especially once you get involved in nested tables etc.

All of the sites I have desinged, have hard coded tables. it not only works better, but also looks better.

Of course this is just my opnion.

Most HTML gurus/classes/books will tell you to stay away from anything relative...ie tables, text sizes, etc.
 
i second nfs.

at my company... lot's of peeps still use netscape 4.
so... anytime any page is design without a concern for mozillas...
we get caught very easily.

whenever possible... stay away for relative length.
 
another trick to learn is to use blank pixel .gif files to set length.

it's a must to get by in this crazy web world. 🙂
 
Originally posted by: hoihtah
another trick to learn is to use blank pixel .gif files to set length.

it's a must to get by in this crazy web world. 🙂


That's basically what I did. I put in a little javascript thing that basically says:
(there's more to the !IE4plus part, but)

if (! IE4plus)
document.write("<img src=pixel.gif width=800 height=0>");

That way for browsers that display it correctly it runs normal, but for ones that have issues with it, they get it set to (at least) 800 wide. Still don't look ideal, but better than it could be.
 
Originally posted by: Chooco
shouldn't "relative size" relate to the resolution? like 100% in 800x600 mean it takes up the full width?

yes, IN THEORY 100% would mean it would take up the whole width, and in IE it does, but for some reason in Netscape/Mozilla/Konquer (or others I've tried) they get confused with tables inside tables inside tables (I think I've got a 3 way nest going), and they make the inner most table only the width of the widest item in the table (in this case the longest word).
 
netscape 4.x cant render tables properly if you do table within table 5 times i believe. thats a lot of tables, but it should still be able to read them. netscape is really picky about closing off tables too. ie will kinda read your code and close off the table for you.
 
I thought Netscape 4.x had problems with even two nested tables.

Anyway, when you set a block element's length to 100%, I think you should make sure that your margin, padding and border widths are all set to 0, otherwise browsers like Mozilla and Opera will start acting ugly. www.w3.org has very good documentation on this, but the width of an element is made up of:
margin-left + border-left + padding-left + width + padding-right + border-right + margin-right
So if you set width to 100% AND you also specify a margin/border/padding value of anything other than 0, your width values will be invalid and will be rendered improperly by stricter browsers like Mozilla.
 
Back
Top