• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 329
  • Last Modified:

Making A Line Bold and Indenting

I have a result that I am outputting on two lines.  I want to make the first line bold and indent the second line (not bold)  How would I format this?

Red Restaurant
      1000 Avenue U

right now I have

Red Restaurant
1000 Avenu U

The code I am using.

<td width="325"><font face="Arial, Helvetica, sans-serif"><?php echo $f1 . "<br/>  " . $f2; ?></font></td>
      <td width="150"><font face="Arial, Helvetica, sans-serif"><?php echo $f3; ?></font></td>
      <td width="100"><font face="Arial, Helvetica, sans-serif"><?php echo $f4; ?></font></td>
      <td width="100"><font face="Arial, Helvetica, sans-serif"><?php echo $f5; ?></font></td>

Open in new window

0
DS928
Asked:
DS928
  • 7
  • 5
1 Solution
 
Loganathan NatarajanLAMP DeveloperCommented:
try this,

 <td width="325" style="font-family:Arial, Helvetica, sans-serif;"><strong><?php echo $f1 . "<br/>  " . $f2; ?></strong></td>
      <td width="150" style="margin-left:15px; font-family:Arial, Helvetica, sans-serif;"><?php echo $f3; ?></td>
      <td width="100" style="margin-left:15px; font-family:Arial, Helvetica, sans-serif;"><?php echo $f4; ?></td>
      <td width="100" style="margin-left:15px; font-family:Arial, Helvetica, sans-serif;"><?php echo $f5; ?></td>

Open in new window

0
 
DS928Author Commented:
Thank You!  Half way there.  Both lines are Bold.  It should be Top line Bold, No indent.
and the Bottom line indent but not Bold.

Red Restaurant
      1000 Avenue U

This is pulling the Data...

<?php
$i=0;
while ($i < $num) {
$f1=mysql_result($result,$i,"RestName");
$f2=mysql_result($result,$i,"Address");
$f3=mysql_result($result,$i,"Phone");
$f4=mysql_result($result,$i,"Price");
$f5=mysql_result($result,$i,"Rating");
?>

Open in new window

0
 
Loganathan NatarajanLAMP DeveloperCommented:
can u post your html full coding?
0
Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

 
Loganathan NatarajanLAMP DeveloperCommented:
try like this,

<table width="100%" border="1">
  <tr>
     <td width="194" style="font-family:Arial, Helvetica, sans-serif;"><strong>Red Restaurant</strong></td>
  </tr>
  <tr>
    <td style="font-family:Arial, Helvetica, sans-serif;"><span style="margin-left:15px; font-family:Arial, Helvetica, sans-serif;">1000 Avenue U</span></td>
  </tr>
</table>

Open in new window

0
 
DS928Author Commented:
Just a quick note.  This provides the line break and the indenting.  The only problem now is having only the top line bold.  I will try the above, and I will post the code.  This is for break, indent.
"<br/><ul>"

Open in new window


The code.
<table width="720" border="0" align="left" cellpadding="0" cellspacing="2" id="results">
<tr>
  <td><table width="720" border="0" align="left" cellpadding="0" cellspacing="2" id="results2">
    <tr>
      <td width="15" bgcolor="#FFDAA6">&nbsp;</td>
      <td width="335"><font face="Arial, Helvetica, sans-serif" style="font-weight:bold">NAME / ADDRESS</font></td>
      <td width="150"><font face="Arial, Helvetica, sans-serif" style="font-weight:bold">PHONE</font></td>
      <td width="100"><font face="Arial, Helvetica, sans-serif" style="font-weight:bold">PRICE</font></td>
      <td width="100"><font face="Arial, Helvetica, sans-serif" style="font-weight:bold">RATING</font></td>
    </tr>
    <?php
$i=0;
while ($i < $num) {
$f1=mysql_result($result,$i,"RestName");
$f2=mysql_result($result,$i,"Address");
$f3=mysql_result($result,$i,"Phone");
$f4=mysql_result($result,$i,"Price");
$f5=mysql_result($result,$i,"Rating");
?>
    <tr>
      <td bgcolor="#FFDAA6">&nbsp;</td>
       <td width="325" style="font-family:Arial, Helvetica, sans-serif;"><strong><?php echo $f1 . "<br/><ul>" . $f2; ?></strong></td>
      <td width="150" style="margin-left:15px; font-family:Arial, Helvetica, sans-serif;"><?php echo $f3; ?></td>
      <td width="100" style="margin-left:15px; font-family:Arial, Helvetica, sans-serif;"><?php echo $f4; ?></td>
      <td width="100" style="margin-left:15px; font-family:Arial, Helvetica, sans-serif;"><?php echo $f5; ?></td>
          </tr>
    <?php

$i++;
}
?>
  </table></td>
</tr>
</table>

Open in new window

0
 
Loganathan NatarajanLAMP DeveloperCommented:
I think, you need not use tables, then.. wait, i will re-structureit
0
 
Loganathan NatarajanLAMP DeveloperCommented:
try this,

<p style="font-weight:bold;">NAME / ADDRESS , PHONE , PRICE, RATING </p>

 <?php
$i=0;
while ($i < $num) {
$f1=mysql_result($result,$i,"RestName");
$f2=mysql_result($result,$i,"Address");
$f3=mysql_result($result,$i,"Phone");
$f4=mysql_result($result,$i,"Price");
$f5=mysql_result($result,$i,"Rating");
?>

<p style="font-family:Arial, Helvetica, sans-serif;">
<strong><?php echo $f1;?></strong> <br />
     <span style="margin-left:15px;"><?php echo $f2; ?></span><br />
	  <span style="margin-left:15px;"><?php echo $f3; ?></span><br />
	<span style="margin-left:15px;"><?php echo $f4; ?></span><br />
<span style="margin-left:15px;"><?php echo $f5; ?></span> 
</p>        
    <?php
$i++;
}
?>

Open in new window

0
 
DS928Author Commented:
Well it makes the restaurant name bold, but.....I kind of need the table thing.  Go here.
http://www.menuhead.net/Steelers/Head.php
click on City>>>>Boston>>>>>>Back Bay>>>>>>>>>>>>>American(New) then  Search.  And you can see what I have going on.  It's all good except for the restaurant name.  If I get that in bold with what I have going on I'll be good.  Thank you for your help.
0
 
Loganathan NatarajanLAMP DeveloperCommented:
it looks like <strong> not applied , see here,

<tr>
      <td bgcolor="#FFDAA6">&nbsp;</td>
      <td width="12" style="font-family:Arial, Helvetica, sans-serif;">&nbsp;</td>
       <td width="329" style="font-family:Arial, Helvetica, sans-serif;">28 Degrees<br/><ul>2222 Newbury Street</td>
      <td width="150" style="margin-left:15px; font-family:Arial, Helvetica, sans-serif;">555-121-3333</td>
      <td width="100" style="margin-left:15px; font-family:Arial, Helvetica, sans-serif;">4$</td>
      <td width="100" style="margin-left:15px; font-family:Arial, Helvetica, sans-serif;">3*</td>
    </tr>
        
   <tr>
      <td bgcolor="#FFDAA6">&nbsp;</td>
      <td width="12" style="font-family:Arial, Helvetica, sans-serif;">&nbsp;</td>
       <td width="329" style="font-family:Arial, Helvetica, sans-serif;">28 Degrees<br/><ul>2223 Newbury Street</td>
      <td width="150" style="margin-left:15px; font-family:Arial, Helvetica, sans-serif;">555-121-3636</td>
      <td width="100" style="margin-left:15px; font-family:Arial, Helvetica, sans-serif;">3$</td>
      <td width="100" style="margin-left:15px; font-family:Arial, Helvetica, sans-serif;">3*</td>
    </tr>
        
   <tr>
      <td bgcolor="#FFDAA6">&nbsp;</td>
      <td width="12" style="font-family:Arial, Helvetica, sans-serif;">&nbsp;</td>
       <td width="329" style="font-family:Arial, Helvetica, sans-serif;">29 Newbury<br/><ul>19 Newbury Street</td>
      <td width="150" style="margin-left:15px; font-family:Arial, Helvetica, sans-serif;">555-121-2222</td>
      <td width="100" style="margin-left:15px; font-family:Arial, Helvetica, sans-serif;">4$</td>
      <td width="100" style="margin-left:15px; font-family:Arial, Helvetica, sans-serif;">4*</td>
    </tr>
      </table></td>

Open in new window

0
 
Loganathan NatarajanLAMP DeveloperCommented:
it suppose to be,

<td width="329" style="font-family:Arial, Helvetica, sans-serif;"><strong>28 Degrees</strong><br/><ul>2222 Newbury Street</td>
0
 
DS928Author Commented:
Right, but the problem is the php.  It won't accept the closing strong.

[/<td width="329" style="font-family:Arial, Helvetica, sans-serif;"><?php echo $f1 . "<br/><ul>" . $f2; ?></td
>

Open in new window


The code throws an error trying to get the </strong> in front of the <br/>
0
 
DS928Author Commented:
I'm giving up on the bold part, I have everything else I need.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 7
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now