Center aligning a table within DIV element
Define the CSS style in css file or header of the HTML page:
div.center {
text-align: center;
}
div.center table {
margin-left: auto;
margin-right: auto;
text-align: left;
}
Here is the HTML (within BODY tag):
<div class="center">
<table><tr><td>Content in center aligned table</td></tr></table>
</div>
Possibly Related posts:
- jQuery pop up message box sliding from left to right and positioning horizontally at the center
Just wrote a simple sliding box script to make a message box appear sliding from left to the middle of web page. The box appears... - How to update a mysql table with the count of another table while using like statement
While working on a web links directory i wanted to update categories table’s num_listings column with the count of listings under each category. The category... - A few notes on joining a MySQL table to itself to get unique combination of field data
Just a few notes on joining a MySQL table to itself to get unique combination of data stored in its fields. Suppose we have a... - Form DOM element not recognized (created) in ajax form in IE when placed with end tag missing
Skipping a form end tag </form> costed me almost a day (i had to go to bed abandoning the fixing for some time though;)). I... - Positioning a pop up element on a browser window
While working in my last CakePHP project i needed a piece of javascript code that should help me in positioning a absolute pop up element...
If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.





