did a Google serach on how to center a table in XHTML.
the HTML code "align=center" does not validate in XHTML, it works but does not validate.
found suggestion that you code "table {margin: 0 auto; text-align: center;}". tried this, and it validates in XHTML. found you did not need the "text-align: center" though.
I think the standard is to creat a "wrapper" div. some people call them wrapper and others call them page-wrapper. but the idea is to surround all your content like so
<html> <head> </head> <body> <div id="wrapper"> Your site content here.
You would need to apply a width property or the margin method won't work. Also, if its just the table as a whole you wish to have centred in the page...
table{ margin:0 auto; width:500px; /* or whatever width you want */ }
I hope this table is being used for tabular data though - and not page layout ;)
the table is for tabular data not for layout. I want to rewrite the curling club website I maintain http://www.stthomascurlingclub.com which currently makes extensive use of tables for layout.
that is my summer project, conversion of the web site to an XHTML and CSS site only using tables for their proper purposes.
Good to hear - and good luck :D . One more thing to bear in mind is that you should use a strict doctype - Not only is this better generally and will help you use correct code/mark-up - but it will force IE6 into non-quirks mode and allow the margin:0 auto; to function correctly.
I have self-taught myself HTML and CSS with help from some of the online tutorials and have tried to use XHTML for the web pages. I have also set them up as STRICT Doctypes.
the HTML code "align=center" does not validate in XHTML, it works but does not validate.
found suggestion that you code "table {margin: 0 auto; text-align: center;}". tried this, and it
validates in XHTML. found you did not need the "text-align: center" though.
Al
<html>
<head>
</head>
<body>
<div id="wrapper">
Your site content here.
</div><!--END wrapper div-->
</body>
</html>
then you can make a style sheet for your site
#wrapper
{
margin:0 auto;
}
I hope this table is being used for tabular data though - and not page layout ;)
the table is for tabular data not for layout. I want to rewrite the curling club website
I maintain http://www.stthomascurlingclub.com which currently makes extensive use
of tables for layout.
that is my summer project, conversion of the web site to an XHTML and CSS site only
using tables for their proper purposes.
Al
have tried to use XHTML for the web pages. I have also set them up as STRICT Doctypes.
Al