| Author |
How should get table centered?
|
|
| dubing@gmail.com 2007-04-03, 6:17 pm |
| 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
| |
|
| On 2007-04-03, dubing@XXXXXXXXXX <dubing@XXXXXXXXXX> 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.
..tx-gooffotoboek-pi1 table { margin-left: auto; margin-right: auto; }
| |
| Gérard Talbot 2007-04-03, 10:21 pm |
| dubing@XXXXXXXXXX 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 <center> or align="center". How to align with CSS?
http://developer.mozilla.org/en/doc..._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/N...lAlignment.html
Gérard
--
Using Web Standards in your Web Pages (Updated Dec. 2006)
http://developer.mozilla.org/en/doc..._your_Web_Pages
| |
| dubing@gmail.com 2007-04-04, 6:22 pm |
| On Apr 3, 6:27 pm, G=E9rard Talbot <newsblahgr...@gtalbot.org> wrote:
> dub...@XXXXXXXXXX wrote :
>
>
>
>
>
>
>
> Using Web Standards in your Web Pages
> Section 2.2.3.2 I use <center> or align=3D"center". How to align with CSS=
?http://developer.mozilla.org/en/doc...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-formatt=
ing
>
> 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 formatin=
ghttp://www.gtalbot.org/NvuSection/NvuWebDesignTips/HorizontalAlignmen...
>
> G=E9rard
> --
> Using Web Standards in your Web Pages (Updated Dec. 2006)http://developer=
..mozilla.org/en/docs/Using_Web_Standards_in_your_Web_...
Excellent. That just did what I expected. Thanks guys for lending a
helping hand. Really appreciated it!!!
Bing
|
|
|
|
| Copyright 2003 - 2008 forum4designers.com Software forum Computer Hardware reviews |