|
Posted by Jonathan N. Little on 06/24/06 17:18
Rik wrote:
<snip>
> Answer to op's problem:
> In rendering a table browsers seem to take the width including the
> borderwidth, and on div's without borderwidth.
>
> Solution to op's proble"m:
> Use percentual margins, and make a table-cell 100%.
Good work! I'll log that on in the old memory banks. Just for further
info, the margin does not have to be a percent, just has to be set and
set the same for both TABLE and DIV. And the table just has to have one
cell per row set to 100%. For best practice should be in your CSS and
not your markup:
TD.inthemiddle { width: 100%; }
....
<tr><td>left</td><td class="inthemiddle">By Margins</td><td>right</td>
Of course if IE were a browser you could have eliminated the extra class
all together with an adjacent sibling selectors
/* sets the 2nd TD in table to 100% width not 'inthemiddle' needed */
TABLE.bymargin TD + TD { width: 100% }
--
Take care,
Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Navigation:
[Reply to this message]
|