FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » syntax question
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: syntax question [message #174337 is a reply to message #174322] Sun, 05 June 2011 21:26 Go to previous messageGo to previous message
Denis McMahon is currently offline  Denis McMahon
Messages: 634
Registered: September 2010
Karma:
Senior Member
On Sat, 04 Jun 2011 11:16:32 -0700, Co wrote:

> Hi,
>
> I have this code inside a php page to display a table.
>
> $outputList .= '
> <table width="100%" border="0"><tr><td width="12%" valign="top"
> rowspan="4"><div style=" height:80px; overflow:hidden;"><a
> href="profile.php?id=' . $member_id . '" target="_self">' . $user_pic .
> '</a></td></tr>
> <tr ><td width="40%" ><div class="name" align="left">' . $firstname . '
> ' . $lastname . ' &nbsp;<font color="#000000" style="font-size: 9pt;
> font-weight: normal"> ' . $date_day . ' ' . $date_month . ' ' .
> $date_year . '</div>
> </td></tr><tr><td width="100%" class="title"><a
> href="Printbb_message.php?id=' . $id . '"> ' . $title . '</a></td></
> tr><tr><td width="100%" valign="left">' . $subject . ' </td></tr></
> table>' if ($i < $itemsPerPage){ echo '<hr>'; } ';
>
> this outputlist is displayed in the page and only if the record is not
> the last on the page I want a line drawn underneath.
> if ($i < $itemsPerPage){ echo '<hr>'; }
>
> How do I fit this code in. I can't get it right.

Oh gods. Lay the code out so you can see it!

If you use the heredoc format, you can lay your code out so that you have
a better chance of spotting missing tags etc. I found at least two
closing tags that were missing (a </div> and a </font>) as well as some
confusion about where the end of the statement was!

What is valign="left" in a td? valign is vertical align and shoyld be one
of top, middle or bottom.

It may be better to apply styles to the td, instead of placing a div
inside a td.

<td width="12%" valign="top" rowspan="4">
<div style=" height:80px; overflow:hidden;">
=>
<td rowspan="4" style="vertical-align:top; width:12%; height:80px;
overflow:hidden;">

and

<td width="40%" >
<div class="name" align="left">
=>
<td class="name" style="text-align:left; width:40%">

If you're going to define a "style" and a color for a font, put the color
in the css

<font color="#000000" style="font-size: 9pt; font-weight: normal">
=>
<font style="color:#000000; font-size: 9pt; font-weight: normal">
or even
<span style="color:#000000; font-size: 9pt; font-weight: normal">

The following is wrapped for nntp convenience:

<?php

$outputList .= <<<EOT

<table width="100%" border="0">
<tr>
<td rowspan="4" style="vertical-align:top; width:12%;
height:80px; overflow:hidden;">
<a href="profile.php?id={$member_id}"
target="_self">{$user_pic}</a>
</td>
</tr>
<tr>
<td class="name" style="text-align:left; width:40%">
{$firstname} {$lastname} &nbsp;
<span style="color:#000000 font-size: 9pt;
font-weight: normal">
{$date_day} {$date_month} {$date_year}
</span>
</td>
</tr>
<tr>
<td width="100%" class="title">
<a href="Printbb_message.php?id={$id}">{$title}</a>
</td>
</tr>
<tr>
<td width="100%">
{$subject}
</td>
</tr>
</table>

EOT;

if ($i < $itemsPerPage) $outputlist .= '<hr>\n';

?>
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: comment utiliser l'addresse book de thunderbird
Next Topic: help with regular expressions
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 21:15:33 GMT 2024

Total time taken to generate the page: 0.04702 seconds