Web Analytics Made Easy -
StatCounter Learning the Legendary DIV Coding - Problems - CodingForum

Announcement

Collapse
No announcement yet.

Learning the Legendary DIV Coding - Problems

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Learning the Legendary DIV Coding - Problems

    Yep. I've read about 20-30 articles about how it's better to use DIV coding rather than tables... In which, I learned by using tables.

    So, I've decided to learn about this legendary form of coding... I've searched google and stuff, but all I'm getting is what you use to do it with, which I need of course, but that's not what I'm looking for. Usually tables you have two columns easily by coding:

    Code:
    <table>
    <tr>
    <td>
    </td>
    <td>
    </td>
    </tr>
    </table>
    But, with DIV's, I'm not sure how to do it. So, this is what I did... I coded the right column (navigation or whatever) with the "float: right;" attribute, and it came up on the right, just not where I wanted it. It should be in "container-b", but instead it's half way below it.

    Check it out, here's the code:

    Code:
    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
    <link rel=\"stylesheet\" href=\"includes/css/stylesheet.css\" style=\"text/css\">
    <title>CHB - the Blog and Portfolio of Connor Hart-Bowlan</title>
    </head>
    <body>
    <div id=\"container-a\">
    <table class=\"button-container\" border=\"0\" cellspacing=\"3\" cellpadding=\"0\">
    <tr>
    <td class=\"button\">
    <a href=\"index.php\">Main</a>
    </td>
    <td class=\"button\">
    <a href=\"?page=about\">About</a>
    </td>
    <td class=\"button\">
    <a href=\"?page=portfoli\">Work</a>
    </td>
    <td class=\"button\">
    <a href=\"?page=stuff\">Stuff</a>
    </td>
    <td class=\"button\">
    <a href=\"?page=link\">Links</a>
    </td>
    <td class=\"button\">
    <a href=\"?page=contact\">Contact</a>
    </td>
    </tr>
    </table>
    <div id=\"container-b\">
    <div id=\"contents\">
    Contents
    </div>
    <div id=\"right-column\">
    Right column
    </div>
    </div>
    </div>
    </body>
    </html>";
    }
    ?>
    Oh by the way, it's not really PHP, it's just that way so I can have more than one page on that file. Just ignore the \"\". And, the table is to even out the buttons you will see above the contents area, and the right column.

    To view what I have, go to:

    http://www.connorhb.com/chb/
    Last edited by somewierdguy; Oct 9, 2006, 04:27 PM.

  • #2
    Oh, yes, also, I just realised I have mispelled my own alias. So, I'm going to register again with it fixed.

    Comment


    • #3
      Looks like you are looking for a fixed layout
      http://bonrouge.com/2c-hf-fixed.php
      Just change #left to right and float it to the right instead of the left.
      ||||If you are getting paid to do a job, don't ask for help on it!||||

      Comment


      • #4
        What? Why would it float left? I want it on the right!

        Comment


        • #5
          That's what he said.
          drums | web

          Comment


          • #6
            I'm lost.

            Comment

            Working...
            X