|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Setting my pages to a fixed width
Hi,
I'm currently using something like this to fix the width of my pages to 800px in the centre of the screen <table width="100%" border="0" align="center" valign="center"> <tr> <td></td> <td width="800"> All my page content here </td> <td></td> </tr> </table> Is there a better/easier/tidier way ? TVM Mike
__________________
If my plea for help relates to a "Sheep", "Flock" or "Medicines" application then it's PHP 4.4.7 and MySQL 4.1.20 Everything else will be PHP 4.3.8 and MySql 4.0.21 |
|
#2
|
|||
|
|||
|
You could try using <div> tags and linking to css.
For example : <div id="container"> Content would go here. </div> This would go in the HTML #container { height : 100% width : 800px } This would go in the CSS Using tables for layout is being discouraged by the standards people. Hope that helps ![]() |
|
#3
|
||||
|
||||
|
Twisted_Daemon didn't get the CSS rule quite right:
Code:
#container {
width: 800px;
margin: 0 auto;
}
You'll need extra code if you want it centered in IE5.x/Win too. I suggest you learn how semantics apply to X/HTML. Semantics is really a very important subject when it comes to X/HTML.
__________________
Spreading knowledge, one newbie at a time. Learn CSS. | PHP includes | X/HTML Validator | CSS validator | Dynamic Site Solutions IE7: the generation 7 browser new in a world of generation 8 browsers. Design/program for Firefox (and/or Opera), apply fixes for IE, not the other way around. |
|
#4
|
|||
|
|||
|
Thanks both. I'd looked at DIV but couldn't find the "width" parameter. I'll switch to using that rather than tables.
The other query I had about this was that on a slow connection the left (empty) table column was loading, then the centre (with content), then the right (empty)... and this was causing the pages to load and then jump to the centre. I'll soon find out if DIVs do the same. If they do, can you think of any way of stopping that ? ATB and many thanks again. Mike |
|
#5
|
|||
|
|||
|
Quote:
There are no parameters for width. If you are talking about CSS, it's called a property. selector { property: value; } Example: #container { width: 800px; } |
|
#6
|
|||
|
|||
|
So did that help you? There is a width ATTRIBUTE, but it is depreciated and you shouldn't use it. CSS should be for styling the page. The makers wouldn't have invented CSS if it wasn't worth it
![]() |
|
#7
|
|||
|
|||
|
Sorry, not had a chance to try it yet - keep getting asked to WORK ! and as this particular database project is personal I have to obey.
I'm gradually finding things I've used on my site I really shouldn't and I'm starting to learn about a CSS (with much help from folks here) so heading down that route. ATB Mike |
![]() |
| Viewing: Dev Shed Forums > Web Design > HTML Programming > Setting my pages to a fixed width |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|