SEO-Board: Free, Fast and Search Engine Optimization Friendly Forum Script
»User: »Password:   Remember Me? 
SEO-Board Forum Software Community / General / Programming / Using .css to align SEO board tables and overall layout
Posted:  13 Oct 2005 19:03
Just wanted to pass this along for anyone having issues with tables or overall aligning their SEO-board. I didn't see this posted (at least doing it this way below).

Using this method aligns everything to whatever width you prefer using <div> inclusion in the styles.

1) Insert the below code into your stylesheet for SEO board:

/* TABLE WIDTH BEGIN */

body {
text-align:center; /* for IE */
}

div#container {
text-align:left; /* reset text alignment */
width:748px; /* or a percentage, or whatever */
margin:0 auto; /* for the rest */
}

/* TABLE WIDTH END */


NOTES: You can set the width to whatever you like, i.e. the example above uses "748px" or you can use 80% or 800px, etc...

2) Now, in your mainheader.htm file, include this line where you see <body> (replace it):

<body>
  <div id="container">
    ...your layout will fall into this location...

3) Now, in your mainfooter.htm file, insert this to close the above div container:

</div>
</body>

NOTES: You can call the "container" whatever you want, like "wrapper" or "tablespan", etc., just as you don't conflict with other style names.

Let me know if I've left anything out. The above code should work properly within Firefox/Opera, IE, and Netscape.

Using the above code (or a variation of it) can help you down the road by not having to edit any other files within the "skin" folder as they relate to table widths.
Posted:  13 Oct 2005 21:27
Thanks for the tip. I should educate myself a bit more on .css because that's a little grey area for me.
__________________
Are you looking for an SEO Consultant?
Email me: hristo at seo-board dot com
Posted:  12 Jun 2008 00:12
This post is old, but it helped me alot. I wanted to have a max width, not static. This is how i did it.

Quote:


/* TABLE WIDTH BEGIN */

body {
text-align:center; /* for IE */
}

div#container {
text-align:left; /* reset text alignment */
max-width:748px; /* or a percentage, or whatever */
width:expression(document.body.clientWidth > 748? "748px": "auto" ); /*This one i added for IE*/
margin:0 auto; /* for the rest */

}

/* TABLE WIDTH END */