Forum Moderators: not2easy
My question is: Can I center the list table with CSS? I'm currently using CSS to "text-align" the content of the cells to the left and would like the whole table to be in the center of the content cell (yeah, the site template is a table too).
I've tried creating a div before the table with "text-align:center" but this does not work, the table doesn't center. Currently I'm using <div align="center>, but that doesn't feel right.
The best thing is put the table in question in a <div> that way you will not affect any of the table's css. Next, the css needs to be:
#table_holder {
width: npx or nem or n% where n is the value /* THIS IS A MUST */
margin: 0 auto;
padding: 0;
text-align: left; /*IE fix */
}
Your HTML
<div id="table_holder">
Your table
</div>
This solution is cross browser friendly and you could assign the CSS to the table and eliminate the <div> if you really must.
Marshall