/    Sign up×
Community /Pin to ProfileBookmark

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?

to post a comment
CSS

7 Comments(s)

Copy linkTweet thisAlerts:
@pyroclasmMar 02.2005 — It should be text-align:center.
Copy linkTweet thisAlerts:
@TriumphMar 02.2005 — [i]Originally posted by amahmood [/i]

[B]<td style='vertical-align:center;'>[/B][/QUOTE]
The keywords for vertical-align are baseline, sub, super, text-top, text-bottom, top, middle and bottom. There is no center.
Copy linkTweet thisAlerts:
@amahmoodauthorMar 02.2005 — Yes, text-align:center worked fine. thanks
Copy linkTweet thisAlerts:
@amahmoodauthorMar 10.2005 — No

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'>
Copy linkTweet thisAlerts:
@pyroclasmMar 11.2005 — Then just apply "text-align:center" to the table tag
Copy linkTweet thisAlerts:
@amahmoodauthorMar 12.2005 — well, 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.
Copy linkTweet thisAlerts:
@toicontienMar 12.2005 — 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.
×

Success!

Help @amahmood spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.3,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...