By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,571 Members | 1,209 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,571 IT Pros & Developers. It's quick & easy.

CSS2 problem: width of a table = 100%

P: n/a
Hello,

I've a problem with a table whose the witdh is 100%. With Firefox, it
correctly fits the width of the parent container, no more. But with
IExplorer, the witdth seems to be equal to the width of the body, so it
enlarges the parent-container.

See http://www.k1ka.be/rubrique.php3?id_rubrique=1
HTML code:
<body>
<div id=corps>
<div id=bandeau>
<table id=navigation>
<tr>
<td id=accueil><a href="http://www.k1ka.be">Accueil</a>/</td>
<td id=autrebranche><a
href="rubrique.php3?id_rubrique=3">Textes</a></td>
<td id=date>Dernière modif.: 23 mai 2006</td>
</tr>
</table>
</div>
(etc.)
CSS:

body {
margin:0;
background-color: white;
}
#corps {
margin: 50px;
padding: 0;
}
#bandeau {
margin: 0;
padding: 0;
}
#navigation {
width:100%;
}

I don't want to use a fixed width for the parent container, because I
hope this page will correctly be displayed with several screenwidthes.
So I use fixed margins for the <div id=corps>. I think that the the
width used in such a case by "width=100%" is the border of the parent
container, without (!) the margins. Am I wrong ?

I Know that the <div id=bandeauis useless, but it results of another
test for the style.

Has someone a solution compatible with firefox+IExplorer ?

Thanks in advance,

G.

Aug 2 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
In article <11**********************@m73g2000cwd.googlegroups .com>,
gv******@skynet.be wrote:
Hello,

I've a problem with a table whose the witdh is 100%. With Firefox, it
correctly fits the width of the parent container, no more. But with
IExplorer, the witdth seems to be equal to the width of the body, so it
enlarges the parent-container.

See http://www.k1ka.be/rubrique.php3?id rubrique=1
HTML code:
<body>
<div id=corps>
<div class="corps">
<div id=bandeau>
<div class="bandeau">

etc. - the double-quotes are important.
Aug 3 '06 #2

P: n/a
David Stone schrieb:
<div class="bandeau">

etc. - the double-quotes are important.
Not necessary in HTML in this case.
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
Aug 3 '06 #3

P: n/a
On Thu, 3 Aug 2006, David Stone wrote:
HTML code:

<div class="bandeau">

etc. - the double-quotes are important.
Er, no: the double-quotes are of no importance in HTML when the string
contains name chars, as in this case. You're welcome to /recommend/
quoting the value, even when not necessary, if you think it improves
consistency and accuracy; but they don't become "important" until you
start delivering XHTML (and let's not go over *that* frequent argument
again).

Aug 3 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.