/    Sign up×
Community /Pin to ProfileBookmark

Center Align Table By ID

I work with an application so I can not control my table tag but i can add CSS. It does not have a class associated with it but it does have an ID.

Looks like…

<table id=main>

The table is 600px and I want it centered in the screen. It is not a nested table.

I tryed. #main{styles etc…} and controled some aspects of the table but could not get the whole think to center.

Thanks for the help.

to post a comment
CSS

2 Comments(s)

Copy linkTweet thisAlerts:
@kpikulauthorApr 11.2006 — I am just over thinking this. since this table hosts all the content I will just use

body{text-align: center;}
Copy linkTweet thisAlerts:
@ray326Apr 12.2006 — That's only for IE. For web browsers you also need to use [B]table#main { margin: 0 auto }[/B].
×

Success!

Help @kpikul 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.18,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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