center vertical

Discussion in 'HTML' started by Wijnand Nijs, Aug 9, 2003.

  1. Wijnand Nijs

    Wijnand Nijs Guest

    I can "center" my table in a window horizontaly. Is there a way to do
    that verticaly? Now I put some <BR> before the table, but the result
    differs from the window size.

    Thanks...
    Wijnand
    Wijnand Nijs, Aug 9, 2003
    #1
    1. Advertising

  2. In article <sU2Za.501$9.net>, darkside@dont-spam-
    re-create-it.co.uk says...
    >
    > "Wijnand Nijs" <> wrote in message
    > news:...
    > > I can "center" my table in a window horizontaly. Is there a way to do
    > > that verticaly? Now I put some <BR> before the table, but the result
    > > differs from the window size.
    > >

    >
    > Like this?
    > http://www.re-create-it.co.uk/
    >
    > It can be done as below
    >
    > <table width="100%" height="100%" align="center">


    There's no "height" attribute for the "table" element.
    http://www.w3.org/TR/html401/struct/tables.html#h-11.2.1

    --
    Hywel
    Hywel Jenkins, Aug 9, 2003
    #2
    1. Advertising

  3. "darkside" <> wrote in message
    news:sU2Za.501$9.net...
    >
    > "Wijnand Nijs" <> wrote in message
    > news:...
    > > I can "center" my table in a window horizontaly. Is there a way to do
    > > that verticaly? Now I put some <BR> before the table, but the result
    > > differs from the window size.
    > >

    >
    > Like this?
    > http://www.re-create-it.co.uk/
    >
    > It can be done as below
    >
    > <table width="100%" height="100%" align="center">
    > <tr align="center">
    > <td>
    > <p>Content here is centered on the screen</p>
    > </td>
    > </tr>
    > </table>


    Please don't give anymore advice.
    There is no height attribute for table.

    Here we see a 100 pct (height and width) table -
    http://karlcore.com/100pcttable/100pctnodtd.php
    Notice how this "works". Unfortunately, it only works because there is no
    DTD. As such, it throws the browser into "Quirks mode".
    Last I checked, it worked in all browsers.

    This may be a suitable "workaround" for some people, but it is not for me. I
    care about the quality of my work and I will not walk around topless with no
    DTD.
    This is the same exact page with an HTML 4.01 Strict DTD -
    http://karlcore.com/100pcttable/100pctwithdtd.php
    Notice that despite the fact that the "height" attribute remains on the
    table element, it does not show up? This is because the browser is no
    longer in "Quirks mode" but is rather following the DTD we have given to it.
    (It is also still not valid markup because of the height attribute)

    Now, there may be a solution to this issue, borrowed from our pal, Brucie
    and a post he made to CIWAH -
    http://karlcore.com/100pcttable/100pctcsswithdtd.php
    This is 100% valid HTML 4.01 Strict and does what is intended by the
    previous poster's bad advice.


    --
    Karl Core

    Charles Sweeney says my sig is fine as it is.
    EightNineThree, Aug 9, 2003
    #3
  4. EightNineThree wrote:

    > Please don't give anymore advice.
    > There is no height attribute for table.
    >
    > Here we see a 100 pct (height and width) table -
    > http://karlcore.com/100pcttable/100pctnodtd.php
    > Notice how this "works". Unfortunately, it only works because there is no
    > DTD. As such, it throws the browser into "Quirks mode".
    > Last I checked, it worked in all browsers.
    >
    > This may be a suitable "workaround" for some people, but it is not for me. I
    > care about the quality of my work and I will not walk around topless with no
    > DTD.
    > This is the same exact page with an HTML 4.01 Strict DTD -
    > http://karlcore.com/100pcttable/100pctwithdtd.php
    > Notice that despite the fact that the "height" attribute remains on the
    > table element, it does not show up? This is because the browser is no
    > longer in "Quirks mode" but is rather following the DTD we have given to it.
    > (It is also still not valid markup because of the height attribute)
    >
    > Now, there may be a solution to this issue, borrowed from our pal, Brucie
    > and a post he made to CIWAH -
    > http://karlcore.com/100pcttable/100pctcsswithdtd.php
    > This is 100% valid HTML 4.01 Strict and does what is intended by the
    > previous poster's bad advice.


    Excellent, 893, this is quite illuminating!
    The third example is usable, after all, at least in some browsers: works
    OK in NN7 (Mac), acceptably in Safari (small margin problems) but not in
    iCab or MSIE (5.2, Mac)...sigh!... whilst the first example (no DTD)
    works in all... re-sigh!...

    So, stick to the first conclusion:
    > There is no height attribute for table.


    --
    Fran├žois de Dardel
    --
    http://mapage.noos.fr/dardelf/
    Utilisez mon adresse sur noos seulement
    Use only my noos e-mail
    =?ISO-8859-1?Q?Fran=E7ois_de_Dardel?=, Aug 9, 2003
    #4
  5. Wijnand Nijs

    Wijnand Nijs Guest

    Hello,

    Thanks a lot for all the response, but...
    I tried the solution from Brucie, but it dosn't work for tables < 100%.
    I am not yet so familiar with real HTML, maybe thats the problem. The
    problem page is:

    http://www.alf4all.demon.nl

    Any advice?

    Thanks and greetings...
    Wijnand

    EightNineThree wrote:

    > "darkside" <> wrote in message
    > news:sU2Za.501$9.net...
    >
    >>"Wijnand Nijs" <> wrote in message
    >>news:...
    >>
    >>>I can "center" my table in a window horizontaly. Is there a way to do
    >>>that verticaly? Now I put some <BR> before the table, but the result
    >>>differs from the window size.
    >>>

    >>
    >>Like this?
    >>http://www.re-create-it.co.uk/
    >>
    >>It can be done as below
    >>
    >><table width="100%" height="100%" align="center">
    >><tr align="center">
    >> <td>
    >><p>Content here is centered on the screen</p>
    >></td>
    >></tr>
    >></table>

    >
    >
    > Please don't give anymore advice.
    > There is no height attribute for table.
    >
    > Here we see a 100 pct (height and width) table -
    > http://karlcore.com/100pcttable/100pctnodtd.php
    > Notice how this "works". Unfortunately, it only works because there is no
    > DTD. As such, it throws the browser into "Quirks mode".
    > Last I checked, it worked in all browsers.
    >
    > This may be a suitable "workaround" for some people, but it is not for me. I
    > care about the quality of my work and I will not walk around topless with no
    > DTD.
    > This is the same exact page with an HTML 4.01 Strict DTD -
    > http://karlcore.com/100pcttable/100pctwithdtd.php
    > Notice that despite the fact that the "height" attribute remains on the
    > table element, it does not show up? This is because the browser is no
    > longer in "Quirks mode" but is rather following the DTD we have given to it.
    > (It is also still not valid markup because of the height attribute)
    >
    > Now, there may be a solution to this issue, borrowed from our pal, Brucie
    > and a post he made to CIWAH -
    > http://karlcore.com/100pcttable/100pctcsswithdtd.php
    > This is 100% valid HTML 4.01 Strict and does what is intended by the
    > previous poster's bad advice.
    >
    >
    Wijnand Nijs, Aug 10, 2003
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rabbit
    Replies:
    1
    Views:
    2,751
    Shimon Sim
    Feb 12, 2006
  2. Eirik Eldorsen
    Replies:
    17
    Views:
    12,489
    cosmic foo
    Aug 4, 2005
  3. Allison McGhee

    Vertical alignment - center

    Allison McGhee, Apr 13, 2006, in forum: HTML
    Replies:
    1
    Views:
    478
    BootNic
    Apr 13, 2006
  4. Allison McGhee

    vertical-align: center

    Allison McGhee, Apr 13, 2006, in forum: HTML
    Replies:
    3
    Views:
    12,544
    Neredbojias
    Apr 13, 2006
  5. Philipp Lenssen

    Vertical center + height?

    Philipp Lenssen, May 10, 2005, in forum: Javascript
    Replies:
    2
    Views:
    68
    Philipp Lenssen
    May 10, 2005
Loading...

Share This Page