shannonlasell Posted October 3, 2005 Share Posted October 3, 2005 I have noticed that align="center" and <center> are deprecated. I have found that using CSS that I may align-text: center; however, this does not work with tables.I could use CSS to give a ( left: #%; ). I was wondering what options (Total) that are available in doing this. Link to comment Share on other sites More sharing options...
boen_robot Posted October 3, 2005 Share Posted October 3, 2005 I think you're wrong about the center not being working with tables. I recently used it and it worked. But you have to place the <table> tag as a selector, not a part of the the table itself. If you select a table cell, the center attribute will only align the data in the cell but not the cell itself(I think).I didn't quite catch, what you meant by "what options (Total) that are available in doing this.".Anyway... I'm a newbie with CSS, so whatever you meant, I'll most probably not know it . Link to comment Share on other sites More sharing options...
F-Man Posted October 3, 2005 Share Posted October 3, 2005 The align property aligns text inside an element, not the element itself. To center a table, set automatic margins, with "margin-left: auto; margin-right: auto" or just "margin: auto". Link to comment Share on other sites More sharing options...
shannonlasell Posted October 4, 2005 Author Share Posted October 4, 2005 thanx for the help Link to comment Share on other sites More sharing options...
shannonlasell Posted October 5, 2005 Author Share Posted October 5, 2005 if have found that the <b>margin:auto;</b> does not center the table in IE.Does anybody have any alternate ideas? Link to comment Share on other sites More sharing options...
shannonlasell Posted October 5, 2005 Author Share Posted October 5, 2005 So, in conclusion, Microsoft sucks!Seriously though, I think I figured it out. If I text-align:center; every container that holds what i am centering, and I set a margin:auto; for everything inside the container then it looks normal.for example:stylesheet:-----------body { text-align:center; // for IE}table { margin:auto; // for Browsers that make more sense than IE}----------------------------page.html:-----------<html> <head> <link rel="stylesheet" type="text/css" href="style.css" /> </head> <body> <table> <tr> <td>Internet Explorer Sucks!</td> </tr> </table> </body></html> Link to comment Share on other sites More sharing options...
F-Man Posted October 5, 2005 Share Posted October 5, 2005 Woa, that's weird...Tried "margin-left: auto; margin-right: auto"? Link to comment Share on other sites More sharing options...
actionsketch Posted October 5, 2005 Share Posted October 5, 2005 I would love to just see a variable in css just called "align". margin: auto is too cryptic. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now