467,915 Members | 1,196 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,915 developers. It's quick & easy.

How should get table centered?

Hi,

I'm trying to do align table center in CSS like this. But it doesn't
work.

..tx-gooffotoboek-pi1 table {
text-align: center;
}

I can do <table align="center"but it's said deprecated. Hence the
how to center table question.

Thanks in advance for any help.

Bing

Apr 3 '07 #1
  • viewed: 4919
Share:
3 Replies
On 2007-04-03, du****@gmail.com <du****@gmail.comwrote:
Hi,

I'm trying to do align table center in CSS like this. But it doesn't
work.

.tx-gooffotoboek-pi1 table {
text-align: center;
}

I can do <table align="center"but it's said deprecated. Hence the
how to center table question.

Thanks in advance for any help.
..tx-gooffotoboek-pi1 table { margin-left: auto; margin-right: auto; }
Apr 3 '07 #2
du****@gmail.com wrote :
Hi,

I'm trying to do align table center in CSS like this. But it doesn't
work.

.tx-gooffotoboek-pi1 table {
text-align: center;
}

I can do <table align="center"but it's said deprecated. Hence the
how to center table question.

Thanks in advance for any help.

Bing

Using Web Standards in your Web Pages
Section 2.2.3.2 I use <centeror align="center". How to align with CSS?
http://developer.mozilla.org/en/docs...your_Web_Pages

The CSS1 text-align property specifies how text or inline elements (like
an image) are aligned within an element.

CSS "margin-left: auto; margin-right: auto;" properties will center a
block-level element within its containing block. Defining margin-left
and margin-right is for block-level elements. When both margin-left and
margin-right are auto, they are set to equal values, thus centering a
block-level element within its parent.

References:
CSS1 horizontal formating
http://www.w3.org/TR/REC-CSS1#horizontal-formatting

Worth mentioning is the excellent tutorial:
Centring using CSS by D. Dorward
http://dorward.me.uk/www/centre/

Also Interactive demo on CSS horizontal alignment and horizontal formating
http://www.gtalbot.org/NvuSection/Nv...Alignment.html

Gérard
--
Using Web Standards in your Web Pages (Updated Dec. 2006)
http://developer.mozilla.org/en/docs...your_Web_Pages
Apr 3 '07 #3
On Apr 3, 6:27 pm, Gérard Talbot <newsblahgr...@gtalbot.orgwrote:
dub...@gmail.com wrote :
Hi,
I'm trying to do align table center in CSS like this. But it doesn't
work.
.tx-gooffotoboek-pi1 table {
text-align: center;
}
I can do <table align="center"but it's said deprecated. Hence the
how to center table question.
Thanks in advance for any help.
Bing

Using Web Standards in your Web Pages
Section 2.2.3.2 I use <centeror align="center". How to align with CSS?http://developer.mozilla.org/en/docs...s_in_your_Web_...

The CSS1 text-align property specifies how text or inline elements (like
an image) are aligned within an element.

CSS "margin-left: auto; margin-right: auto;" properties will center a
block-level element within its containing block. Defining margin-left
and margin-right is for block-level elements. When both margin-left and
margin-right are auto, they are set to equal values, thus centering a
block-level element within its parent.

References:
CSS1 horizontal formatinghttp://www.w3.org/TR/REC-CSS1#horizontal-formatting

Worth mentioning is the excellent tutorial:
Centring using CSS by D. Dorwardhttp://dorward.me.uk/www/centre/

Also Interactive demo on CSS horizontal alignment and horizontal formatinghttp://www.gtalbot.org/NvuSection/NvuWebDesignTips/HorizontalAlignmen...

Gérard
--
Using Web Standards in your Web Pages (Updated Dec. 2006)http://developer..mozilla.org/en/doc...s_in_your_Web_...
Excellent. That just did what I expected. Thanks guys for lending a
helping hand. Really appreciated it!!!

Bing

Apr 4 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Bjoern Wolfgardt | last post: by
20 posts views Thread by Tyler Carver | last post: by
1 post views Thread by Richard | last post: by
11 posts views Thread by tangler | last post: by
16 posts views Thread by Tantale | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.