Help - Search - Members - Calendar
Full Version: HTML Tables
HTMLHelp Forums > Web Authoring > Markup (HTML, XHTML, XML)
diabolik
I don't think it's the PHP that's the problem, it's the HTML that holds it in place. I'm using an application called Bitrix Site Manager which generates an html pager based on a template.

This is the code behind the template:

QUOTE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<META NAME="ROBOTS" content="ALL">
<? $APPLICATION->ShowMeta("keywords")?>
<? $APPLICATION->ShowMeta("description")?>
<title><? $APPLICATION->ShowTitle()?></title>
<? $APPLICATION->ShowCSS();?>
</HEAD>
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-2403294-4";
urchinTracker();
</script>
<body> <? $APPLICATION->ShowPanel();?>
<div style="background: rgb(85, 25, 1) url(/bitrix/templates/6690/images/back-body.jpg) repeat-x scroll left top; width: 100%; height: 100%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
<div style="background: transparent url(/bitrix/templates/6690/images/back-footer.jpg) repeat-x scroll left bottom; width: 100%; height: 100%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
<table width="100%" height="100%" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr> <td width="50%" height="100%"><img width="1" height="1" src="/bitrix/templates/6690/images/spacer.gif" /></td> <td width="749" valign="top" height="100%">
<table height="100%" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr> <td width="749" valign="top" height="222" style="background: transparent url(/bitrix/templates/6690/images/flash_header.jpg) no-repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
<div style="margin-left: 40px; margin-top: 21px; width: 400px; text-align: left;" class="comp_name"> <? $APPLICATION->IncludeFile("include_areas/company_name.php", Array(), Array("MODE"=>"html"));?></div>

<div><img width="749" height="55" src="/bitrix/templates/6690/images/spacer.gif" /></div>
</td> </tr>

<tr> <td valign="top" height="2"><img width="749" height="2" border="0" src="/bitrix/templates/6690/images/slise.gif" alt="" /></td> </tr>

<tr><td valign="top" align="center" style="background: transparent url(/bitrix/templates/6690/images/tal_main.jpg) repeat-y scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
<script type="text/javascript">
var AdBrite_Title_Color = 'FFFFFF';
var AdBrite_Text_Color = 'CCCCCC';
var AdBrite_Background_Color = 'CC0000';
var AdBrite_Border_Color = 'F2984C';
</script>
<span style="white-space: nowrap;">
<script src="http://ads.adbrite.com/mb/text_group.php?sid=459452&zs=3732385f3930" type="text/javascript"></script>
<a target="_top" href="http://www.adbrite.com/mb/commerce/purchase_form.php?opid=459452&amp;afsid=1"><img width="14" height="90" border="0" src="http://files.adbrite.com/mb/images/adbrite-your-ad-here-leaderboard.gif" style="background-color: rgb(242, 152, 76);" alt="Your Ad Here" /></a></span> </td></tr> <tr> <td valign="top" height="35" align="center" style="background: transparent url(/bitrix/templates/6690/images/tal_main.jpg) repeat-y scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
<div style="margin-left: 4px; margin-bottom: 2px;"> <?$APPLICATION->IncludeComponent(
"bitrix:menu",
"top_menu1",
Array(
"ROOT_MENU_TYPE" => "top",
"MAX_LEVEL" => "1",
"CHILD_MENU_TYPE" => "left",
"USE_EXT" => "Y"
)
);?>
</div></td> </tr>


<tr>
<td valign="top" height="378" bgcolor="#d0071e">
<table width="100%" cellspacing="0" cellpadding="0" border="0" background="/bitrix/templates/6690/images/tal_main.jpg" style="border-left: 1px solid rgb(0, 0, 0); border-right: 1px solid rgb(0, 0, 0); background-repeat: repeat-y;">
<tbody>
<tr> <td width="248" valign="top"> <?
$CHECK1 = substr($APPLICATION->GetCurPage(), 0, strlen($APPLICATION->GetCurPage())-4)."_inc.php";

if (file_exists($_SERVER["DOCUMENT_ROOT"].$CHECK1) OR file_exists($_SERVER["DOCUMENT_ROOT"].$APPLICATION->GetCurDir()."sect_inc.php")):
?> <?
$CHECK1 = substr($APPLICATION->GetCurPage(), 0, strlen($APPLICATION->GetCurPage())-4)."_left.php";

if (file_exists($_SERVER["DOCUMENT_ROOT"].$CHECK1) OR file_exists($_SERVER["DOCUMENT_ROOT"].$APPLICATION->GetCurDir()."sect_left.php")):
?>
<table cellspacing="0" cellpadding="0" border="0" bgcolor="#81040b">
<tbody>
<tr> <td width="248" valign="top" style="background: transparent url(/bitrix/templates/6690/images/tal_h.gif) repeat-x scroll 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
<div style="padding: 6px 10px 6px 9px; background: transparent url(/bitrix/templates/6690/images/tal_v.gif) repeat-y scroll 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"> <? $APPLICATION->IncludeFile(substr($APPLICATION->GetCurPage(), 0, strlen($APPLICATION->GetCurPage())-4)."_inc.php", Array(), Array("MODE"=>"html", "NAME"=>GetMessage("PAGE_INC"), "TEMPLATE"=>"page_inc.php"));?> <? $APPLICATION->IncludeFile($APPLICATION->GetCurDir()."sect_inc.php", Array(), Array("MODE"=>"html", "NAME"=>GetMessage("SECT_INC"), "TEMPLATE"=>"sect_inc.php"));?> </div>

<div style="height: 5px;"><img width="248" height="5" border="0" alt="" src="/bitrix/templates/6690/images/bot_l_t.gif" /></div>
</td> </tr>

<? else:?><tr > <td valign="top" style="width: 0px; height: 0px; font-size: 0px; line-height: 0px;"> <? $APPLICATION->IncludeFile(substr($APPLICATION->GetCurPage(), 0, strlen($APPLICATION->GetCurPage())-4)."_inc.php", Array(), Array("MODE"=>"html", "NAME"=>GetMessage("PAGE_INC"), "TEMPLATE"=>"page_inc.php"));?> <? $APPLICATION->IncludeFile($APPLICATION->GetCurDir()."sect_inc.php", Array(), Array("MODE"=>"html", "NAME"=>GetMessage("SECT_INC"), "TEMPLATE"=>"sect_inc.php"));?> </td> </tr>

<? endif;?>

<tr> <td width="248" height="168" bgcolor="#410303" style="background: transparent url(/bitrix/templates/6690/images/back_l_b.gif) no-repeat scroll 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
<div style="padding: 6px 10px 6px 9px; background: transparent url(/bitrix/templates/6690/images/tal_v_l_b.gif) repeat-y scroll 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"> <? $APPLICATION->IncludeFile(substr($APPLICATION->GetCurPage(), 0, strlen($APPLICATION->GetCurPage())-4)."_left.php", Array(), Array("MODE"=>"html", "NAME"=>GetMessage("PAGE_INC"), "TEMPLATE"=>"page_left.php"));?> <? $APPLICATION->IncludeFile($APPLICATION->GetCurDir()."sect_left.php", Array(), Array("MODE"=>"html", "NAME"=>GetMessage("SECT_INC"), "TEMPLATE"=>"sect_left.php"));?> </div>

<div style="height: 3px;"><img width="248" height="3" border="0" alt="" src="/bitrix/templates/6690/images/bot_l_b.gif" /></div>
</td> </tr>

<? else:?><tr > <td valign="top" style="width: 0px; height: 0px; font-size: 0px; line-height: 0px;"> <? $APPLICATION->IncludeFile(substr($APPLICATION->GetCurPage(), 0, strlen($APPLICATION->GetCurPage())-4)."_left.php", Array(), Array("MODE"=>"html", "NAME"=>GetMessage("PAGE_INC"), "TEMPLATE"=>"page_left.php"));?> <? $APPLICATION->IncludeFile($APPLICATION->GetCurDir()."sect_left.php", Array(), Array("MODE"=>"html", "NAME"=>GetMessage("SECT_INC"), "TEMPLATE"=>"sect_left.php"));?> </td> </tr>

<? endif;?>
</tbody>
</table>
</td> <td width="100%" valign="top" bgcolor="#d0071e">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr> <td width="501" valign="top" height="210" style="padding: 2px; width: 100%;">
<div style="border: 3px solid rgb(255, 24, 30); padding: 6px 10px 6px 9px; background: rgb(88, 5, 12) url(/bitrix/templates/6690/images/back_r_.jpg) no-repeat scroll 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr> <td width="100%" valign="top" height="33">
<table width="100%" cellspacing="0" cellpadding="0" border="0" class="zgl_01">
<tbody>
<tr> <td style="background: transparent url(/bitrix/templates/6690/images/inc03_l.gif) no-repeat scroll 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; width: 5px;"><img width="5" src="/bitrix/templates/6690/images/spacer.gif" /></td> <td valign="top" class="zgl_01_td" style="background: transparent url(/bitrix/templates/6690/images/inc03_rep.gif) repeat-x scroll 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; width: 100%;">
<table cellspacing="0" cellpadding="0" border="0" style="background: transparent url(/bitrix/templates/6690/images/inc_inc_rep.gif) repeat-x scroll 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
<tbody>
<tr> <td valign="top" class="zgl_01_cont">
<h1><? $APPLICATION->ShowTitle(); ?></h1>
</td> </tr>
</tbody>
</table>
</td> <td style="background: transparent url(/bitrix/templates/6690/images/inc03_r.gif) no-repeat scroll 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; width: 9px;"><img width="9" src="/bitrix/templates/6690/images/spacer.gif" /></td> </tr>
</tbody>
</table>
</td> </tr>

<tr> <td height="166"> #WORK_AREA# </td> </tr>
</tbody>
</table>
</div>
</td> <td width="122" valign="middle" height="604" align="right" border="1" style="background: transparent url(/bitrix/templates/6690/images/tal_main.jpg) repeat-y scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
<script type="text/javascript">
var AdBrite_Title_Color = 'FFFFFF';
var AdBrite_Text_Color = '999999';
var AdBrite_Background_Color = '940F04';
var AdBrite_Border_Color = 'FFFFFF';
</script>

<script src="http://ads.adbrite.com/mb/text_group.php?sid=473231&zs=3132305f363030" type="text/javascript"></script>

<div><a style="font-weight: bold; font-family: Arial; font-size: 13px;" href="http://www.adbrite.com/mb/commerce/purchase_form.php?opid=473231&amp;afsid=1" target="_top">Your Ad Here</a></div>
</td> </tr>
</tbody>
</table>
</td> </tr>
</tbody>
</table>
</td> </tr>

<tr><td valign="middle" height="99" background="/bitrix/templates/6690/images/tal_main.jpg" style="border-left: 1px solid rgb(0, 0, 0); border-right: 1px solid rgb(0, 0, 0); background-repeat: repeat-y;">
<table width="100%" cellspacing="0" cellpadding="0" border="0" background="/bitrix/templates/6690/images/tal_main.jpg" style="border-left: 0px solid rgb(0, 0, 0); border-right: 0px solid rgb(0, 0, 0); background-repeat: repeat-y;">
<tbody>
<tr><td width="249" valign="top" height="89" align="center"><img border="0" src="/bitrix/templates/6690/images/cotwbanner.jpg" /></td> <td width="249" valign="top" height="89" align="center"><img border="0" src="/bitrix/templates/6690/images/blogbanner.jpg" /></td> <td width="249" valign="top" height="89" align="center"><img border="0" src="/bitrix/templates/6690/images/forumbanner.jpg" /></td> </tr>
</tbody>
</table>
</td> </tr>

<tr><td valign="top" align="center" style="background: transparent url(/bitrix/templates/6690/images/tal_main.jpg) repeat-y scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
<script type="text/javascript">
var AdBrite_Title_Color = 'FFFFFF';
var AdBrite_Text_Color = 'E6E6E6';
var AdBrite_Background_Color = 'CC0000';
var AdBrite_Border_Color = 'FFFFFF';
</script>
<span style="white-space: nowrap;">
<script src="http://ads.adbrite.com/mb/text_group.php?sid=471582&zs=3732385f3930" type="text/javascript"></script>
<a href="http://www.adbrite.com/mb/commerce/purchase_form.php?opid=471582&amp;afsid=1" target="_top"><img width="14" height="90" border="0" alt="Your Ad Here" style="background-color: rgb(255, 255, 255);" src="http://files.adbrite.com/mb/images/adbrite-your-ad-here-leaderboard.gif" /></a></span> </td></tr>

<tr> <td valign="top" height="100%">
<table height="100%" cellspacing="0" cellpadding="0" border="0" style="background: transparent url(/bitrix/templates/6690/images/tal_back.gif) repeat-y scroll 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; width: 100%;">
<tbody>
<tr> <td valign="top" height="100%" style="background: transparent url(/bitrix/templates/6690/images/back_bot.jpg) no-repeat scroll center top; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; width: 100%;">
<div align="center" style="margin-top: 19px; margin-bottom: 15px; color: rgb(244, 197, 9);" class="main_text"> <? $APPLICATION->IncludeFile("include_areas/copyright.php", Array(), Array("MODE"=>"html"));?> </div>
</td> </tr>
</tbody>
</table>
</td> </tr>
</tbody>
</table>
</td> <td width="50%" height="100%"><img width="1" height="1" src="/bitrix/templates/6690/images/spacer.gif" /></td> </tr>
</tbody>
</table>
</div>
</div>
</body>
</html>

<!--####################################################################### -->


Now look at the page it generates:

http://203.121.66.220/news/

I probably don't need to say what's wrong with that, but you can see it's all over the place wacko.gif

Oddly enough, on this page - http://203.121.66.220/index.php - the layout is almost correct and the only thing which is different between the two pages is that the one that has the almost correct layout has some include files added to it whereas the other one is just a blank page.

As I say, I don't think the PHP is what is wrong with it, just that the tables are messed up so it's displaying the information wrong. So if anyone could help, it would be most appreciated as the support people for the application don't do user support ( rolleyes.gif ) and the problem is most likely just related to thehtml of the template.

Thanks.
pandy
For some reason both validators say the page can't be found. If you use one of the other methods to feed the code to the validator you'll find that among other errors some are related to the table structure. A broken table does funny things and mending it is good place to start. There seems to almost endless and seemingly pointless nesting going on there too.
http://htmlhelp.com/tools/validator/
pandy
Maybe I'd better add that you should validate the generated HTML without the PHP code. View Source and grab it.
diabolik
Thanks, I've solved it now. I didn't find out what the problem was though, I reloaded the original template then added the bits from the messed up one I knew were correct and it's working.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.