?
Solved

Making A Line Bold and Indenting

Posted on 2013-01-27
12
Medium Priority
?
326 Views
Last Modified: 2013-01-29
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
Comment
Question by:DS928
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 5
12 Comments
 
LVL 36

Expert Comment

by:Loganathan Natarajan
ID: 38825636
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
 

Author Comment

by:DS928
ID: 38825645
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
 
LVL 36

Expert Comment

by:Loganathan Natarajan
ID: 38825664
can u post your html full coding?
0
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 36

Accepted Solution

by:
Loganathan Natarajan earned 2000 total points
ID: 38825676
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
 

Author Comment

by:DS928
ID: 38825684
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
 
LVL 36

Expert Comment

by:Loganathan Natarajan
ID: 38825689
I think, you need not use tables, then.. wait, i will re-structureit
0
 
LVL 36

Expert Comment

by:Loganathan Natarajan
ID: 38825699
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
 

Author Comment

by:DS928
ID: 38825712
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
 
LVL 36

Expert Comment

by:Loganathan Natarajan
ID: 38825798
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
 
LVL 36

Expert Comment

by:Loganathan Natarajan
ID: 38825800
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
 

Author Comment

by:DS928
ID: 38828526
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
 

Author Comment

by:DS928
ID: 38832253
I'm giving up on the bold part, I have everything else I need.
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
In this article, I’ll talk about multi-threaded slave statistics printed in MySQL error log file.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question