Connecting Tech Pros Worldwide Forums | Help | Site Map

Tables in PHP?

Newbie
 
Join Date: Jul 2008
Posts: 2
#1: Jul 6 '08
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...


Expand|Select|Wrap|Line Numbers
  1. <table width="158" border="0" align="left" cellpadding="0" cellspacing="0">
  2.   <tr>
  3.     <td><?php require(DIR_WS_BOXES . 'search.php') ?></td>
  4.   </tr>
  5.   <tr>
  6.     <td><?php if ((USE_CACHE == 'true') && empty($SID)) {
  7.     echo tep_cache_categories_box();
  8.   } else {
  9.     include(DIR_WS_BOXES . 'categories.php');
  10.   } ?></td>
  11.   </tr>
  12.   <tr>
  13.     <td><?php require(DIR_WS_BOXES . 'whats_new.php'); ?></td>
  14.   </tr>
  15.   <tr>
  16.     <td><?php require(DIR_WS_BOXES . 'information.php');
  17.   if (ADSENSE_SHOW == 'true')
  18.  
  19. { if ($request_type == NONSSL) 
  20.  
  21.   { 
  22.   /* only show adsense in NON SSL else it causes warning */ ?></td>
  23.   </tr>
  24.   <tr>
  25.     <td><?php include(DIR_WS_BOXES . 'resources.php');
  26.  
  27.   }
  28.  
  29. }
  30.  
  31.  
  32. ?></td>
  33.   </tr>
  34.   <tr>
  35.     <td><?php if ($banner = tep_banner_exists('dynamic', 'left_1')) {
  36.   }
  37.   echo tep_display_banner('static', $banner); ?></td>
  38.   </tr>
  39.   <tr>
  40.     <td><?php require(DIR_WS_BOXES . 'badges.php'); ?></td>
  41.   </tr>
  42. </table>
  43.  




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's Avatar
Moderator
 
Join Date: Jun 2007
Location: York, England, with wolves.
Posts: 4,938
#2: Jul 6 '08

re: Tables in PHP?


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.
Newbie
 
Join Date: Jul 2008
Posts: 2
#3: Jul 6 '08

re: Tables in PHP?


Quote:

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..
Markus's Avatar
Moderator
 
Join Date: Jun 2007
Location: York, England, with wolves.
Posts: 4,938
#4: Jul 6 '08

re: Tables in PHP?


Quote:

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.
Markus's Avatar
Moderator
 
Join Date: Jun 2007
Location: York, England, with wolves.
Posts: 4,938
#5: Jul 6 '08

re: Tables in PHP?


Quote:

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.
Reply