March 29, 201016 yr Hey guys I just cant figure this out. I have a table set up, 1 row with mutiple images, and it scrolls horizontally.I want the table with all the content to be centered in the middle of the page. Been trying a bunch of stuff just cant figure it out. thanks <div id="content-press" class="content" style="background:fff;"> <table height="250" class="content" padding:5;> .content{ text-align:center; } #content-press { font-size: 1.1em; margin: 0; padding: 0; width: 800px; height: 340px; background-color: #fff; overflow: auto; position: relative; z-index: 0; } any ideas?
March 29, 201016 yr You got a link or some more of the page coding fella? Then we might be able to help you easier....
March 29, 201016 yr If the #content-press is the parent of the table, use the width and margin: 0 auto:- #content-press { font-size: 1.1em; margin: 0 auto; /*was 0;*/ padding: 0; width: 800px; height: 340px; background-color: #fff; overflow: auto; position: relative; z-index: 0; } The #content-press should then center in its parent (perhaps the page body) and the table will fill the 800px. If the table is less than 800px you will have to give it a width and center that inside #content-press:- #content-press table { width: ??px; margin: 0 auto; }
Create an account or sign in to comment