TonyJollans
Programmer
Still struggling to understand ...
Can someone please explain the difference between the following two samples.
I want to specify as much as possible in style sheets but can't seem to get it to work. In the two samples below, the only significant difference (as far as I understand it) is the placing of the width attribute. The border is just to provide a visual aid - it makes no obvious difference to what happens.
1. Width attribute given on table tag.
2. Width attribute given in style.
Whilst they appear to do the same in IE, in Firefox the table in the second sample is just wide enough for the content.
This is a deliberately simplified example to highlight my lack of understanding. The effect is not limited to the width attribute - it is just an easy one to demonstrate. There is clearly something I don't understand, but what?
Enjoy,
Tony
--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at VBAExpress[
Can someone please explain the difference between the following two samples.
I want to specify as much as possible in style sheets but can't seem to get it to work. In the two samples below, the only significant difference (as far as I understand it) is the placing of the width attribute. The border is just to provide a visual aid - it makes no obvious difference to what happens.
1. Width attribute given on table tag.
Code:
<HEAD>
</HEAD>
<BODY>
<TABLE width = "100%" border = "2" >
<TR><TD>First Cell</TD><TD>Second Cell</TD></TR>
</TABLE>
</BODY>
2. Width attribute given in style.
Code:
<HEAD>
<style>
table { width: "100%"; }
</style>
</HEAD>
<BODY>
<table border = "2" >
<TR><TD>First Cell</TD><TD>Second Cell</TD></TR>
</table>
</BODY>
Whilst they appear to do the same in IE, in Firefox the table in the second sample is just wide enough for the content.
This is a deliberately simplified example to highlight my lack of understanding. The effect is not limited to the width attribute - it is just an easy one to demonstrate. There is clearly something I don't understand, but what?
Enjoy,
Tony
--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at VBAExpress[