Using a "style width" in the table, instead of just
Using a div instead of a span doesn't change anything (I tried that). However it may be more "correct", by definition.
Using "100%" in the <td> doesn't change anything (I tried that as well). You just set the minimum width with it -- if the text doesn't fit in the cell, the cell will just expand (and 100% still means "all of the cell")
Also, using "1%" in the image is just a way to handle situations where the image is very small (I don't remember why, but at some point it had a meaning:-) Using "1%" makes the cell always be exactly as large as the image.
Removing the 1% (and also removing the align=right) will make the image not display aligned to the right, if the text is short.
Thus, the change in html (div instead of span, td 100%, remove img 1%) doesn't make any difference at all.
Did you try it in some browser? Did you see any difference in your html and mine?
At least, it exactly the same in my IE7? What browser do you use, to see any difference?
Main Topics
Browse All Topics





by: GreenGhostPosted on 2008-12-13 at 16:02:52ID: 23166020
The widths that you specify on table cells are minimum widths, so specifying 1% will not make the cell smaller. You have to specify a width on the other cell to make that wider.
The correct width of the element containing the text would be "100%" or "auto". You should however use a block element (e.g. div) instead of an inline element (span). A div has the default width set to "auto", so you don't have to specify that.
Select allOpen in new window