You are here: Re: Using CSS instead of tables - great idea but how?? « HTML « IT news, forums, messages
Re: Using CSS instead of tables - great idea but how??

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация