the equivalent of align in css?

in html when you put align=center in a td tag the text aligns to the center of the tag but the same wouldn't work in style for example:
<td style='align:center' >
or
<td style='vertical-align:center;'>
or
<td style='text-align:center'>

what is the equivalent of align in css?It should be text-align:center.Originally posted by amahmood
<td style='vertical-align:center;'> The keywords for vertical-align are baseline, sub, super, text-top, text-bottom, top, middle and bottom. There is no center.Yes, text-align:center worked fine. thanksNo

I made a mistake.

text-align:center, aligns the text inside the table to center but doesn't align the table itself.

I am looking for css equivalent of ALIGN='CENTER' in something like this:
<TABLE ALIGN='CENTER'>Then just apply "text-align:center" to the table tagwell, you see
this does what i want:
<table align='center'><tr><td>my first table</td></tr></table>

but this doesn't.
<table style='text-align:center'><tr><td>my second table</td></tr></table>

the second one align the text (or perhaps every thing else) inside the table.

Thanks anyway.The text-align CSS property only works on inline elements, like text, span, strong, em, etc. A table is a block level element. A Block level element is centered by setting its left and right margins to auto.

Can we see the page you're working on? That might help in solving the problem too.
 
Back
Top