CSS Horizontal Align
Moderator: General Moderators
-
php_wiz_kid
- Forum Contributor
- Posts: 181
- Joined: Tue Jun 24, 2003 7:33 pm
CSS Horizontal Align
What's the CSS attribute for horizontal align in for the table element?
-
microthick
- Forum Regular
- Posts: 543
- Joined: Wed Sep 24, 2003 2:15 pm
- Location: Vancouver, BC
I'm not sure there's a specific attribute for horizontal alignment to replace the align="center" attribute that html has for tables.
Your best bet is probably to wrap the table in a <div> and then style the div with <div style="display: block; float: center;" ...>.
Of course, if you're simply wanting to set horizontal alignment for a table cell, that's just text-align: center.
Your best bet is probably to wrap the table in a <div> and then style the div with <div style="display: block; float: center;" ...>.
Of course, if you're simply wanting to set horizontal alignment for a table cell, that's just text-align: center.
-
php_wiz_kid
- Forum Contributor
- Posts: 181
- Joined: Tue Jun 24, 2003 7:33 pm
What do you mean horizontal align a table element?
You mean you want to do this in CSS:
If not please say soemthing, I am sure I can help you out.
You mean you want to do this in CSS:
Code: Select all
<table>
<tr><td align="center">Centered</td></tr>
</table>-
Cruzado_Mainfrm
- Forum Contributor
- Posts: 346
- Joined: Sun Jun 15, 2003 11:22 pm
- Location: Miami, FL
-
php_wiz_kid
- Forum Contributor
- Posts: 181
- Joined: Tue Jun 24, 2003 7:33 pm
Code: Select all
table { text-align: center; }Code: Select all
table { text-align: center; }Code: Select all
table td { text-align: left; }- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
Stick a div around the table:
Mac
Code: Select all
<div style="text-align: center;">
<table>
...
</table>
</div>