Help me rewrite this HTML Code

Discussion in 'Web Programming' started by ZidoBX, Aug 7, 2012.

Help me rewrite this HTML Code
  1. Unread #1 - Aug 7, 2012 at 5:44 PM
  2. ZidoBX
    Joined:
    Jul 12, 2012
    Posts:
    45
    Referrals:
    0
    Sythe Gold:
    0

    ZidoBX Member
    Banned

    Help me rewrite this HTML Code

    This is how the code currently is right now. Basically its two tables next to each other.

    Instead of the tables next to each other I want them to be one on top of another, could someone please re-write this code for me and place "google_map" on the top table & the script type in the lower table.

    Thank you so much.

     
  3. Unread #2 - Aug 7, 2012 at 7:01 PM
  4. Dial
    Joined:
    Jul 12, 2010
    Posts:
    5,739
    Referrals:
    32
    Sythe Gold:
    126
    Sythe's 10th Anniversary Two Factor Authentication User MushyMuncher Member of the Month Winner Easter 2015

    Dial Experienced Web Developer
    $200 USD Donor New Pirate PHP Programmers

    Help me rewrite this HTML Code

    <td> = A new column within a row.
    <tr> = A new row.

    So your current code has new <td>'s instead of a new <tr> to start a new row, which would bump it down to a new row. Your new code would look like this.

    Code:
    <div style='border-top: 1px solid #DDDDDD;'>
    <table>
    <tr>
    <td style='width:300px;'>google_map</td>
    </tr>
    <tr>
    <td style='padding: 10px 0px;'>
    <script type="text/javascript"><!--google_ad_client = "00";
    /* 250 by 250 SQ */
    google_ad_slot = "00";
    google_ad_width = 250;
    google_ad_height = 250;
    //-->
    </script>
    <script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>
    </td>
    </tr>
    </table>
    </div>
    [COLOR="Red"]</td>
    </tr>
    </table>[/COLOR]
    I'm really not sure why you have that extra

    Code:
    [COLOR="Red"]</td>
    </tr>
    </table>[/COLOR]
    At the bottom though, unless you started a table above, and just finish it there and didn't show us that code.

    Also, this is not what tables are meant for. I know it's easy to use in layouts, but it's not proper HTML. It's used to put data into rows, not have div's. The proper way would be to have two div's beside each other, using style="float:left;" for one of them, and style="float:right;" for the other, that way they float right beside each other.

    Actually, you don't even want them beside each other. Let me re-do your code using div's, you'll see how much nicer and clean it is, plus it's good to learn that way as it's proper.

    Code:
    <div style='border-top: 1px solid #DDDDDD;'>
    <div style='width:300px;'>google_map</div>
    <div style='padding: 10px 0px;'>
    <script type="text/javascript"><!--google_ad_client = "00";
    /* 250 by 250 SQ */
    google_ad_slot = "00";
    google_ad_width = 250;
    google_ad_height = 250;
    //-->
    </script>
    <script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>
    </div>
    </div>
    [COLOR="Red"]</td>
    </tr>
    </table>[/COLOR]
    As for the part in red on the bottom, I'm still not sure why it's there. Unless there's another table above it that is around this, you should delete that part.
     
< Best Website Design Tool? | Just4Dream.eu >

Users viewing this thread
1 guest


 
 
Adblock breaks this site