How do you center a table in FireFox?
I have used the tags <center> </center> and my table centers fine in IE but not FireFox. How do I get a table to center in FireFox?
Thanks in advance for any help,
yeto
Thanks in advance for any help,
yeto
I searched on the internet for a solution and found this code but I do not know where to place it or if it would even work.
body {
text-align: center;
text-align: -moz-center;
}
Thanks,
yeto
body {
text-align: center;
text-align: -moz-center;
}
Thanks,
yeto
I also found this code but again I don't know how to use it.
table.center {
margin-left:auto;
margin-right:auto;
}
<table class="center">
...
</table>
body {text-align:center;}
Thanks,
yeto
table.center {
margin-left:auto;
margin-right:auto;
}
<table class="center">
...
</table>
body {text-align:center;}
Thanks,
yeto
The html tag <center></center> is not supported in HTML5, which may be the reason for your problem. The centering is instead best handled by CSS.
I get the impression from your posts (
) that you are probably not using any external CSS, so a quick and simple way would be to use an in-line style:
This is essentially a compact version of what you have in your last post, with the addition of "0" for top and bottom margins, which you can change as needed...
Check this out for reference:
http://www.w3schools.com/cssref/pr_margin.asp
I get the impression from your posts (

<table style="margin:0 auto;">
<tr>
<td>
centered text
</td>
</tr>
</table>
<tr>
<td>
centered text
</td>
</tr>
</table>
This is essentially a compact version of what you have in your last post, with the addition of "0" for top and bottom margins, which you can change as needed...
Check this out for reference:
http://www.w3schools.com/cssref/pr_margin.asp
Per
www.mingas.com
www.mingas.com
I am using VSD so it is my understanding that I could enter css code in the header tag if that would be easier. I posted my question here instead of the VSD forum because I felt like people here would have more insight related to code.
I have both the registered/paid versions of VSD and Html Editor.
Would it be easier to enter css code in the header tag versus in-line style?
Thanks in advance for any additional help,
yeto
I have both the registered/paid versions of VSD and Html Editor.
Would it be easier to enter css code in the header tag versus in-line style?
Thanks in advance for any additional help,
yeto
Yes, it would be best to put the style in the head section:
and then the class for the table in the body section:
<head>
........
<style>
table.center {margin:0 auto;}
</style>
.......
</head>
........
<style>
table.center {margin:0 auto;}
</style>
.......
</head>
and then the class for the table in the body section:
<body>
......
<table class="center">[...content here...]</table>
......
</body>
......
<table class="center">[...content here...]</table>
......
</body>
Per
www.mingas.com
www.mingas.com
Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.