Center website

Discussion in 'HTML' started by Hugo, Jun 4, 2008.

  1. Hugo

    Hugo Guest

    Hey guys,

    I want to center a table that is bigger than my screen resolution. So
    in other words the middle of the table has to be in the middle of my
    screen and on any other resolution it has to be the middle. How is
    this possible?

    <div align="center"> does not work
    the whole <table><tr><td align="center"> ... does also not work

    Any ideas? Thanks
     
    Hugo, Jun 4, 2008
    #1
    1. Advertising

  2. Hugo

    Roderik Guest

    Hugo schreef:
    > Hey guys,
    >
    > I want to center a table that is bigger than my screen resolution. So
    > in other words the middle of the table has to be in the middle of my
    > screen and on any other resolution it has to be the middle. How is
    > this possible?
    >
    > <div align="center"> does not work
    > the whole <table><tr><td align="center"> ... does also not work
    >
    > Any ideas? Thanks


    If it has to be centered when the table is wider than your browser
    viewport you need some javascript to scroll to the right position
    (consider asking in comp.lang.javascript).

    --
    http://www.archytas.nl/
    webdesign, internet applicaties, internetgestuurde elektronica
     
    Roderik, Jun 4, 2008
    #2
    1. Advertising

  3. Hugo

    richard Guest

    On Wed, 4 Jun 2008 11:45:16 -0700 (PDT), Hugo
    <> wrote:

    >Hey guys,
    >
    >I want to center a table that is bigger than my screen resolution. So
    >in other words the middle of the table has to be in the middle of my
    >screen and on any other resolution it has to be the middle. How is
    >this possible?
    >
    ><div align="center">


    This tells the content of the division to be centered.
    It should read <div style="align:center;">


    > does not work
    >the whole <table><tr><td align="center"> ... does also not work


    Again, the content of the data cell is centered, not the table.

    You might want to try <center><table></table></center>
    You should also learn the proper methods to code using CSS.


    >
    >Any ideas? Thanks
     
    richard, Jun 5, 2008
    #3
  4. Hugo wrote:

    > I want to center a table that is bigger than my screen resolution. So
    > in other words the middle of the table has to be in the middle of my
    > screen and on any other resolution it has to be the middle. How is
    > this possible?


    What's in this table?

    I do not think what you describe is possible. To do so, would require a
    horizontal scrollbar to "start in the middle." And hat will you do for
    me? My monitor is 1680 pixels wide, but my browser window is probably
    750-800 pixels.

    Use a flexible design instead.

    --
    -bts
    -Friends don't let friends drive Windows
     
    Beauregard T. Shagnasty, Jun 5, 2008
    #4
  5. On Jun 4, 2:45 pm, Hugo <> wrote:
    > <div align="center"> does not work
    > the whole <table><tr><td align="center"> ... does also not work
    > Any ideas? Thanks


    What are you really trying to do? Having a table that is larger than
    the "screen resolution" (or browser window) and centering it will mean
    that you want the use to scroll left and right. My guess is that
    rather than scroll left and right, they will just look at you as
    incompetent and go elsewhere.
     
    Travis Newbury, Jun 5, 2008
    #5
  6. Stiffy wrote:

    > Well starch my britches and call me "Stiffy", I agree with Beau for a
    > change!


    Good morning, Stiffy. ;-)

    --
    -bts
    -Friends don't let friends drive Windows
     
    Beauregard T. Shagnasty, Jun 5, 2008
    #6
  7. Hugo

    richard Guest

    On Thu, 5 Jun 2008 03:07:11 +0000 (UTC), Neredbojias
    <me@http://www.neredbojias.net/_eml/fliam.php> wrote:

    >On 04 Jun 2008, richard <> wrote:
    >
    >> On Wed, 4 Jun 2008 11:45:16 -0700 (PDT), Hugo
    >> <> wrote:
    >>
    >>>Hey guys,
    >>>
    >>>I want to center a table that is bigger than my screen resolution. So
    >>>in other words the middle of the table has to be in the middle of my
    >>>screen and on any other resolution it has to be the middle. How is
    >>>this possible?
    >>>
    >>><div align="center">

    >>
    >> This tells the content of the division to be centered.
    >> It should read <div style="align:center;">

    >
    >I think you meant <div style="text-align:center;">
    >



    I was showing that his coding was in error and how to correct it.
    Align and text-align are two different things.
     
    richard, Jun 5, 2008
    #7
  8. Hugo

    Steve Pugh Guest

    On Jun 5, 1:24 pm, richard <> wrote:
    > On Thu, 5 Jun 2008 03:07:11 +0000 (UTC), Neredbojias
    > <me@http://www.neredbojias.net/_eml/fliam.php> wrote:
    > >On 04 Jun 2008, richard <> wrote:

    >
    > >> On Wed, 4 Jun 2008 11:45:16 -0700 (PDT), Hugo
    > >> <> wrote:


    > >>><div align="center">

    >
    > >> This tells the content of the division to be centered.
    > >> It should read <div style="align:center;">

    >
    > >I think you meant <div style="text-align:center;">

    >
    > I was showing that his coding was in error and how to correct it.


    But your correction was a bigger error than his original. At least his
    was valid HTML, your's was just made up rubbish.

    > Align and text-align are two different things.


    There are indeed. One of them is an HTML attribiute and one of them is
    a CSS property.

    There is no align property in CSS (see http://www.w3.org/TR/CSS21/propidx.html)
    so style="align: center" is nonsense.

    To align the text contents of a block use text-align: center; To align
    the block itself use margin-left: auto; margin-right: auto;
    The HTML align="center" does both and a bit more (it also aligns any
    child blocks) and has no single equivalent in CSS.

    Steve
     
    Steve Pugh, Jun 5, 2008
    #8
  9. Hugo

    Els Guest

    richard wrote:

    > On Thu, 5 Jun 2008 03:07:11 +0000 (UTC), Neredbojias
    > <me@http://www.neredbojias.net/_eml/fliam.php> wrote:
    >
    >>On 04 Jun 2008, richard <> wrote:
    >>
    >>> It should read <div style="align:center;">

    >>
    >> I think you meant <div style="text-align:center;">

    >
    > I was showing that his coding was in error and how to correct it.


    In order to show people how to correct things, it does help to show
    them correct examples.

    > Align and text-align are two different things.


    You are correct of course, as the text-align property exists in CSS,
    and the align property doesn't. Entirely different things indeed :)

    --
    Els http://locusmeus.com/
     
    Els, Jun 5, 2008
    #9
  10. Hugo

    richard Guest

    On Thu, 5 Jun 2008 15:07:14 +0200, Els <> wrote:

    >richard wrote:
    >
    >> On Thu, 5 Jun 2008 03:07:11 +0000 (UTC), Neredbojias
    >> <me@http://www.neredbojias.net/_eml/fliam.php> wrote:
    >>
    >>>On 04 Jun 2008, richard <> wrote:
    >>>
    >>>> It should read <div style="align:center;">
    >>>
    >>> I think you meant <div style="text-align:center;">

    >>
    >> I was showing that his coding was in error and how to correct it.

    >
    >In order to show people how to correct things, it does help to show
    >them correct examples.
    >
    >> Align and text-align are two different things.

    >
    >You are correct of course, as the text-align property exists in CSS,
    >and the align property doesn't. Entirely different things indeed :)



    I was attempting to point out why his method was failing and that he
    should learn more about how to correct it himself.
    Trying to point out that table coding and division coding have
    different conventions. As he was failing to understand how and when to
    use the proper coding to achieve what he wanted.
    Even though what he really wants to have happen, ain't gonna happen.
     
    richard, Jun 5, 2008
    #10
  11. Scripsit Steve Pugh:

    > To align the text contents of a block use text-align: center; To align
    > the block itself use margin-left: auto; margin-right: auto;
    > The HTML align="center" does both and a bit more (it also aligns any
    > child blocks) and has no single equivalent in CSS.


    It's a bit more complicated than that. The attribute align="center" does
    different things depending on which element you use it. For a <div>, it
    centers each line and each inner block but not the <div> block itself
    (as you can see by setting a width on it). For a <table>, it centers the
    table block only.

    --
    Jukka K. Korpela ("Yucca")
    http://www.cs.tut.fi/~jkorpela/
     
    Jukka K. Korpela, Jun 5, 2008
    #11
  12. Hugo

    dorayme Guest

    In article
    <>,
    Steve Pugh <> wrote:

    > To align the text contents of a block use text-align: center; To align
    > the block itself use margin-left: auto; margin-right: auto;
    > The HTML align="center" does both and a bit more (it also aligns any
    > child blocks) and has no single equivalent in CSS.


    Someone or other might find this draft of something I knocked up useful:

    <http://netweaver.com.au/centring/>

    --
    dorayme
     
    dorayme, Jun 6, 2008
    #12
    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. Flip
    Replies:
    1
    Views:
    440
    Karl Seguin
    Nov 22, 2005
  2. Shawn

    Website on a website.

    Shawn, Jan 15, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    490
    Shawn
    Jan 15, 2006
  3. sck10
    Replies:
    1
    Views:
    423
    Michael Kolias
    Apr 13, 2006
  4. Adrian Wood

    Update website via website?

    Adrian Wood, Feb 22, 2004, in forum: HTML
    Replies:
    13
    Views:
    706
    Adrian Wood
    Feb 25, 2004
  5. A Leon
    Replies:
    4
    Views:
    492
    A Leon
    Mar 4, 2004
Loading...

Share This Page