XML tag

liunx

Guest
I am have been having problems centering a table with CSS in IE. After a while I figured out that if I took off <?xml version="1.0" encoding="us-ascii"?> from the top of my document that the centering would work just fine. Is there a way to make it so the table center with CSS and with the xml tag still being there?<br />
<br />
<?xml version="1.0" encoding="UTF-8"?><br />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><br />
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" ><br />
<head><br />
<title>Test</title><br />
<style type="text/css"><br />
.center<br />
{ <br />
margin-left: auto;<br />
margin-right: auto;<br />
}<br />
</style><br />
</head><br />
<body><br />
<table class="center"><br />
<tr><br />
<td>foobar</td><br />
<td>Some dummy text here.</td><br />
</tr><br />
</table><br />
</body><br />
</html><!--content--><table style="text-align:center;"> works in Internet Explorer but NOT Mozilla. I don't believe "text-align" was supposed to actually align the table itself, just the text inside it, but for some reason, it works.<br />
<br />
And if it doesn't, put the table in a <div> tag with the style I wrote.<!--content-->remove<br />
<br />
<?xml version="1.0" encoding="UTF-8"?><br />
<br />
you don't need it as it is very buggy in IE.<!--content-->Well scoutt...my whole site is PHP and is all xml. I have this at the top of my pages:<br />
<br />
<?php echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?".">"; ?><br />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"<br />
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><br />
<html xmlns="http://www.w3.org/1999/xhtml"><br />
<br />
Should I remove that first line too?<!--content-->yes, it puts IE in quirks mode.<!--content-->
 
Back
Top