Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS table without table

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #29026
    revok
    Participant

    Hi

    I am building a website for a client who basically wants a table layout.
    [img]http://www.simontornby.dk/archive/help.png[/img]

    I want to build it with divs instead.
    I am thinking of making 5 vertical div columns, with each of the red squares as seperate divs.

    Here is my questions:

    -How do I center my content in each of the divs?
    the content will be a combination of headers and differently shaped images.

    -Is there a smarter way of doing this?

    Thank You
    /Simon

    #75727
    noahgelman
    Participant

    Of course using tables is bad when used for layouts, but there are exceptions. For example, if the whole site’s layout is built to look like a table, then use a table. Trying to pull it off using divs might end up being less semantic. But who knows, I’m having a hard time wrapping my head around what your actual site will look like when there’s real content and images.

    Anyways. The content can be centered just like you center all content. As for the images, if can set them up as background images, you can use center center no-repeat and the images will automatically center themselves in the div/table.

    #75728
    TheDoc
    Member

    The vertical align in a div has always been a tough one for me.

    If each div is going to be the same height, I think you can look into using the line-height method:

    http://blog.themeforest.net/tutorials/v … -with-css/

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘CSS’ is closed to new topics and replies.