Tables in PHP?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • DannyMacD
    New Member
    • Jul 2008
    • 2

    Tables in PHP?

    Hello,

    im new to the coding world and need a little help please.

    i understand to get a table layout within PHP coding you cannot use basic html..

    is there a specific way to get the table to work within PHP? example...


    Code:
    <table width="158" border="0" align="left" cellpadding="0" cellspacing="0">
      <tr>
        <td><?php require(DIR_WS_BOXES . 'search.php') ?></td>
      </tr>
      <tr>
        <td><?php if ((USE_CACHE == 'true') && empty($SID)) {
        echo tep_cache_categories_box();
      } else {
        include(DIR_WS_BOXES . 'categories.php');
      } ?></td>
      </tr>
      <tr>
        <td><?php require(DIR_WS_BOXES . 'whats_new.php'); ?></td>
      </tr>
      <tr>
        <td><?php require(DIR_WS_BOXES . 'information.php');
      if (ADSENSE_SHOW == 'true')
    
    { if ($request_type == NONSSL) 
    
      { 
      /* only show adsense in NON SSL else it causes warning */ ?></td>
      </tr>
      <tr>
        <td><?php include(DIR_WS_BOXES . 'resources.php');
    
      }
    
    }
     
       
    ?></td>
      </tr>
      <tr>
        <td><?php if ($banner = tep_banner_exists('dynamic', 'left_1')) {
      }
      echo tep_display_banner('static', $banner); ?></td>
      </tr>
      <tr>
        <td><?php require(DIR_WS_BOXES . 'badges.php'); ?></td>
      </tr>
    </table>




    all the PHP works fine its just when the site loads it pushes all the other stuff below it and not keep this column to the right.... help???
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    This isn't 'table within PHP' but 'PHP within tables'.

    Please use code tags when posting code on the forums.

    The tables are being pushed -- this is a blind guess -- because of the size of data you are putting into them.

    Comment

    • DannyMacD
      New Member
      • Jul 2008
      • 2

      #3
      Originally posted by markusn00b
      This isn't 'table within PHP' but 'PHP within tables'.

      Please use code tags when posting code on the forums.

      The tables are being pushed -- this is a blind guess -- because of the size of data you are putting into them.

      oh sorry about the tags.. new to the forum my bad.

      but if the information isnt within tables the site looks fine but not in the order i want it to be..

      Comment

      • Markus
        Recognized Expert Expert
        • Jun 2007
        • 6092

        #4
        Originally posted by DannyMacD
        oh sorry about the tags.. new to the forum my bad.

        but if the information isnt within tables the site looks fine but not in the order i want it to be..
        Tables will stretch for the size of data in the cells, therefor skewing the alignment.

        Are you using tables for a layout? Bad idea.

        Comment

        • Markus
          Recognized Expert Expert
          • Jun 2007
          • 6092

          #5
          Originally posted by DannyMacD
          but if the information isnt within tables the site looks fine but not in the order i want it to be..
          Exaclty: this isn't a php problem, but a html one.

          Comment

          Working...