|
Posted by dingbat on 08/11/05 14:16
chrisn@nildram.co.uk wrote:
> Anyway, here's what I'm trying to do, I have a genuine table for data,
> which I want to fill the horizontal width of the screen, with a margin
> all around it.
Try this:
<style type="text/css" > /* Use the type attribute */
body {
margin: 0px;
}
table {
border: 1px solid silver;
margin: 10px;
/* 90% not 100%
Obviously you can't "fill" and "have a margin" at the same time.
*/
width: 90%;
/* These will center it */
margin-left: auto;
margin-right: auto;
/*
Your choice of fixed-width and auto margins
OR
fixed margins (maybe in em units) and auto-width is a personal choice,
depending on contents and context. Try it out both ways, try it with a
range of window widths. Remember to think not just about how it looks
in the ideal case, but also how it re-scales when you drag the window
about
*/
}
td {
border: 1px solid silver;
}
/* typo fixed in the selector */
div#Header {
background-color: silver;
height: 40px;
}
</style>
> My target browser is IE 5.1 and upwards.
Heresy ! Try targetting "the web" instead of a browser.
Navigation:
[Reply to this message]
|