+ Reply to Thread
Results 1 to 4 of 4

Thread: DIV as Table?

  1. #1
    Twinkie is offline Banned Twinkie is an unknown quantity at this point
    Join Date
    Sep 2007
    Location
    Ft. Lauderdale, Florida
    Posts
    1,389

    DIV as Table?

    Could someone do me a favor and look at the source code of http://twinkie.pcriot.com and tell me if it is possible to accomplish the same effect the table does with DIV tags and CSS? Thanks a lot
    HTML Code:
    <style type="text/css">
    body { margin:0px; background-color:#204274; color:#FFFFFF;}
    a { text-decoration:none; color:#FFFFFF; font-weight: bold; }
    a:visited { text-decoration:none; color:#FFFFFF; font-weight: bold; }
    a:hover { text-decoration:underline; color:#FFFFFF; font-weight: bold; }
    div.words {
    width: 466px;
    }
    
    div.a {
    margin: 5px;
    }
    
    table.mytable td {
    text-align: center;
    }
    </style>
    </head>
     <body><div align="center">
    <script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script><script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script><script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script><br />
    <script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script><script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script><script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script><br />
    <table border="0" cellspacing="0" cellpadding="0" class="mytable" margin="0" padding="0"><tr><td>
    <script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script>
    <div class="a"><script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script></div>
    <div class="a"><script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script></div>
    <div class="a"><script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script></div>
    <div class="a"><script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script></div>
    </td><td><div class="words"><h2>This Web Site is Under Construction</h2>
    <p>This site is under contruction. It is a personal testing site to develope web applications and to improve my scripting skills. This is not used for any purpose as of yet. I will be adding a home page with links to all of my web applications soon. What I am working on now is creating my home page and posting my first ever web site! It was a socal studies fair project about the Boston Massacre!</p>
    <p>"The great thing about this paragraph is that once you realize it does not say anything, it is too late to stop reading it. You must be a real <b>loser</b> be reading this. Now that you have read the whole thing, go away!" - Walmart Shirt</p>
    <p><u>My First Web Project</u></p></div></td><td>
    <script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script>
    <div class="a"><script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script></div>
    <div class="a"><script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script></div>
    <div class="a"><script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script></div>
    <div class="a"><script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script></div></td></tr></table>
    <script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script><script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script><script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script><br />
    <script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script><script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script><script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script><br />
    <script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script><script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script><script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script><br />
    <script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script><script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script><script type="text/javascript" src="http://x10hosting.com/adserve.js?MTwinkie"></script><br />
    </center>

  2. #2
    Scoochi2's Avatar
    Scoochi2 is offline x10 Sophmore Scoochi2 is an unknown quantity at this point
    Join Date
    Aug 2008
    Location
    Southport!
    Posts
    185

    Re: DIV as Table?

    Maybe it's just me, but I see absolutely no purpose for that table... I mean, it does nothing.
    Except centre the text.

    Yeah, you can do that in a DIV
    Code:
    div {
    margin: 5px;
    text-align: center;
    }
    Last edited by Scoochi2; 09-29-2008 at 10:58 AM.
    If anyone can see it, my post was meant for anyone who reads it. Don't take it personally or think I'm being condescending... :nuts:

  3. #3
    Twinkie is offline Banned Twinkie is an unknown quantity at this point
    Join Date
    Sep 2007
    Location
    Ft. Lauderdale, Florida
    Posts
    1,389

    Re: DIV as Table?

    The idea for the table is to keep that line a line. DIV use line breaks as default and for some reason, the ad object lost it's margin. So, I had to use a DIV to give it that margin back. Then, it did not want to stay in line and thus, the table. Do you know how I could have avoided the table?

    PS: I don't think that would work because of the default line breaks in the DIV would separate the line.

  4. #4
    scopey is offline x10Hosting Member scopey is an unknown quantity at this point
    Join Date
    May 2008
    Posts
    62

    Re: DIV as Table?

    Read up on google. Making tables out of divs uses a good knowledge of the float: and display: css attributes... Something I can't help with. In my experience, div tables are just a lot more hassle than tables. I would just stick to tables, no point in changing unless you come across any limitations.
    - When in doubt, refer to the PHP manual.

+ Reply to Thread

Similar Threads

  1. MysQL Query for Master table & child table
    By phpasks in forum Programming Help
    Replies: 8
    Last Post: 08-07-2008, 08:07 AM
  2. Enabling IP addresses in your firewall.
    By 1337scape in forum Free Hosting
    Replies: 32
    Last Post: 11-15-2007, 01:40 PM
  3. INSERT command denied??
    By 1337scape in forum Free Hosting
    Replies: 6
    Last Post: 11-14-2007, 05:15 PM
  4. [IPB] Contiguous Board Index
    By phenetic in forum Tutorials
    Replies: 5
    Last Post: 09-18-2005, 10:31 AM
  5. Table inside table
    By wizeman in forum Tutorials
    Replies: 4
    Last Post: 07-11-2005, 05:56 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers