Jump to content

Tables won't stay straight in php


gizmorattler

Recommended Posts

I don't get why these columns won't stay side by side vertically. I've tried playing around with the css. Please help.

 

<body>
<?php include_once "header_template.php"; ?>

<div id="site_body" align="center">
<table width="735" border="0" height="1">
  <tr>
    <td> </td>
  </tr>
</table>

<table width="749" height="150" border="1" align="center" bordercolor="" class="wrap">
  <tr>
    <td width="240" height="100%" align="left" valign="top"><div id="spry_box" align="center"><?php include_once "spry_Collapsable_panal.php"; ?></div></td>
    <td width="255" align="center" valign="top"><div id="join_form_box" align="center"><?php include_once "join_form.php"; ?></div></td>
     <td width="240" align="right" valign="top"><div id="right_AD_box" align="center"><?php include_once "right_AD_template.php"; ?></div></td>
  </tr>
</table>
</div>

<?php include_once "footer_template.php"; ?>
</body>

Link to comment
https://forums.phpfreaks.com/topic/215196-tables-wont-stay-straight-in-php/
Share on other sites

Why are you using tables at all when you can, and should be, using just CSS for your layout?

Because sometimes, CSS is more trouble than it's worth. Sometimes you just need a table.

 

Though, I'm not sure that's the case in this situation. Err, by "side by side vertically" you mean one on top of the other? Well I'll assume so...

 

Seems there's a lot of redundant tags there.  Anyway, I suggest you remove all the widths. For webdesign, in general, absolute widths or heights are a big no-no. If you must set a width, do it on the outer-most DIV.

 

Also, it will be less of a headache if you decide now whether to code all the layout in the CSS or the HTML. In other words, if you want to set width/height, do it in the CSS or HTML only, but not both. Otherwise the clashing will result in major headaches.

I strongly disagree with iridy saying CSS is more trouble than its worth. Get it right and it works cross browser, is easy to update, gives absolute positioning the list goes on. The advantages are immense compared to tables.

 

I am not sure what you mean by "side by side vertically" either?? If something is side by side then surely that must be horizontally?

 

Without seeing what your include files contain it is difficult to offer an opinion on this because they could be breaking the table structure.

 

GT

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.