Center Site without Table

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Center Site without Table

dirk newbold
Hi,

I'm trying to center all the pages of my site, I've had no luck with the style sheets and the only way I've been able to achieve it is to place the holding div block inside a table as per the following:

html table align: 'center'; with: [ html tableRow: [ html tableData: [
html div id: 'holding'; with: [ ]]]]

I'm guessing that this can't be best practise and I was wondering if anyone could set me straight.

Cheers,

Dirk

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Center Site without Table

Conrad Taylor
Where's the stylesheet?  Please post it.

On 8/28/07, dirk newbold <[hidden email]> wrote:
Hi,

I'm trying to center all the pages of my site, I've had no luck with the style sheets and the only way I've been able to achieve it is to place the holding div block inside a table as per the following:

html table align: 'center'; with: [ html tableRow: [ html tableData: [
html div id: 'holding'; with: [ ]]]]
 

I'm guessing that this can't be best practise and I was wondering if anyone could set me straight.

Cheers,

Dirk

_______________________________________________
Seaside mailing list
[hidden email][hidden email]
<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank"> http://lists.squeakfoundation<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">.org/cgi-bin/mailman/listinfo/seaside



_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Center Site without Table

Lukas Renggli
> > I'm trying to center all the pages of my site, I've had no luck with the
> style sheets and the only way I've been able to achieve it is to place the
> holding div block inside a table as per the following:

Did you type 'css center page' into Google?

This explanation seems to be quite nice:

     http://www.maxdesign.com.au/presentation/center/

Cheers,
Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Center Site without Table

dirk newbold
Yeah I'd tried that.

This is what didn't work (I'm testing in FireFox 2.0.0.6):

renderContentOn: html
    html div id: 'container'; with: [
        html div id: 'holdingPage'; with: [ ]].

style
    ^'
    body {
        text-align: center;
    }

    #container {
        float: left;
        margin-left: auto;
        margin-right: auto;
        width: 100% (or even: 1020px);
        border: 1px solid black;
    }

    #holdingPage {
        float: left;
        padding: 0px 0px 0px 0px;   
        text-align: center;
        width: 980px;
        border: 1px solid black;
    }'


This is what worked:

renderContentOn: html
    html table align: 'center'; with: [ html tableRow: [ html tableData: [
        html div id: 'holdingPage'; with: [ ]]]]


style
    ^'
    #holdingPage {
        float: left;
        padding: 0px 0px 0px 0px;   
        text-align: center;
        width: 980px;
        border: 1px solid black;
    }'

Cheers,

Dirk

On 8/28/07, Lukas Renggli <[hidden email]> wrote:
> > I'm trying to center all the pages of my site, I've had no luck with the
> style sheets and the only way I've been able to achieve it is to place the
> holding div block inside a table as per the following:

Did you type 'css center page' into Google?

This explanation seems to be quite nice:

     http://www.maxdesign.com.au/presentation/center/

Cheers,
Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Center Site without Table

Lukas Renggli
>     #container {
>         float: left;

float destroys the positioning, you have to remove this line.

>         width: 100% (or even: 1020px);

width has to be set to something smaller, e.g. 600px or 80%

>     #holdingPage {
>         float: left;
>         padding: 0px 0px 0px 0px;
>         text-align: center;
>         width: 980px;
>         border: 1px solid black;
>     }'

That's not necessary.

Cheers,
Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Center Site without Table

dirk newbold
Bingo!!!

Cheers - All working now.

Dirk


On 8/28/07, Lukas Renggli <[hidden email]> wrote:
>     #container {
>         float: left;

float destroys the positioning, you have to remove this line.

>         width: 100% (or even: 1020px);

width has to be set to something smaller, e.g. 600px or 80%

>     #holdingPage {
>         float: left;
>         padding: 0px 0px 0px 0px;
>         text-align: center;
>         width: 980px;
>         border: 1px solid black;
>     }'

That's not necessary.

Cheers,
Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: Center Site without Table

Sebastian Sastre-2
In reply to this post by dirk newbold
Hi Dirk,
 
    I do this with tables. I've made a Layout object that makes that for any component you configure transparently. I do use tables for basic layout because of cross browser compatibility with simplicity. By the way tables are born to layout. Decoupling that from the app is a story you can solve in you app design (keeping presentation decoupled from model at seaside components level)
 
I'm not a fan of tableless styling. Css is vey good for lot of things. It really would be better if it have arrived ten years earlier. You simply can't do all (style) with css painlessly. Anyway for a tableless solution like you want take a look at:
 
 
    I was needing a more general solution for basic layouting. After about 4-6 hours of pain implementing my layouter object tableless sucessfully I found that this approach let me with the visual view that I needed but (for the same price) it gave me the left column deaf to mouse events. What a deal ..
 
    So before ended that day I've reimplemented the layouter painlessly with tables in about an hour and the page I needed in about the next 5 min. It works without hacks, result guaranteed, in all browsers.
 
    FYI W3C is working to make a standard of tables in CSS (because they born to layout) which will be great because I think they will standard it in a pretty elegant solution that, off course, todays no browser vendor interprets the same way if they are paying attention to it at all.  That was what convinced me to forget forcing me to stylize tableless todays.
       
    cheers,
 

Sebastian Sastre

 


De: [hidden email] [mailto:[hidden email]] En nombre de dirk newbold
Enviado el: Martes, 28 de Agosto de 2007 07:22
Para: Seaside - general discussion
Asunto: [Seaside] Center Site without Table

Hi,

I'm trying to center all the pages of my site, I've had no luck with the style sheets and the only way I've been able to achieve it is to place the holding div block inside a table as per the following:

html table align: 'center'; with: [ html tableRow: [ html tableData: [
html div id: 'holding'; with: [ ]]]]

I'm guessing that this can't be best practise and I was wondering if anyone could set me straight.

Cheers,

Dirk

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Center Site without Table

dirk newbold
Sebastian,

Thanks very much for you comments, advice and link - I had been coming to the same conclusion myself but all my friends with a lot more experience than me kept ensuring me that tables = bad practise.

Cheers,

Dirk




On 8/28/07, Sebastian Sastre <[hidden email]> wrote:
Hi Dirk,
 
    I do this with tables. I've made a Layout object that makes that for any component you configure transparently. I do use tables for basic layout because of cross browser compatibility with simplicity. By the way tables are born to layout. Decoupling that from the app is a story you can solve in you app design (keeping presentation decoupled from model at seaside components level)
 
I'm not a fan of tableless styling. Css is vey good for lot of things. It really would be better if it have arrived ten years earlier. You simply can't do all (style) with css painlessly. Anyway for a tableless solution like you want take a look at:
 
<a href="http://www.alistapart.com/articles/holygrail" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.alistapart.com/articles/holygrail
 
    I was needing a more general solution for basic layouting. After about 4-6 hours of pain implementing my layouter object tableless sucessfully I found that this approach let me with the visual view that I needed but (for the same price) it gave me the left column deaf to mouse events. What a deal ..
 
    So before ended that day I've reimplemented the layouter painlessly with tables in about an hour and the page I needed in about the next 5 min. It works without hacks, result guaranteed, in all browsers.
 
    FYI W3C is working to make a standard of tables in CSS (because they born to layout) which will be great because I think they will standard it in a pretty elegant solution that, off course, todays no browser vendor interprets the same way if they are paying attention to it at all.  That was what convinced me to forget forcing me to stylize tableless todays.
       
    cheers,
 

Sebastian Sastre

 


De: [hidden email] [mailto:[hidden email]] En nombre de dirk newbold
Enviado el: Martes, 28 de Agosto de 2007 07:22
Para: Seaside - general discussion
Asunto: [Seaside] Center Site without Table

Hi,

I'm trying to center all the pages of my site, I've had no luck with the style sheets and the only way I've been able to achieve it is to place the holding div block inside a table as per the following:

html table align: 'center'; with: [ html tableRow: [ html tableData: [
html div id: 'holding'; with: [ ]]]]

I'm guessing that this can't be best practise and I was wondering if anyone could set me straight.

Cheers,

Dirk

_______________________________________________
Seaside mailing list
[hidden email]
<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside



_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Center Site without Table

Jason Johnson-3
dirk newbold wrote:
> Sebastian,
>
> Thanks very much for you comments, advice and link - I had been coming
> to the same conclusion myself but all my friends with a lot more
> experience than me kept ensuring me that tables = bad practise.
>
> Cheers,
>
> Dirk

I agree with your friends.  If we keep giving up and using tables then
there is no incentive to make CSS better since everyone uses tables.  
However, I think if CSS has a table layout that would be nice and
simple.  Just not in the HTML.
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside