Solved

Making A Line Bold and Indenting

Posted on 2013-01-27
12
321 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
  • 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
 
LVL 36

Accepted Solution

by:
Loganathan Natarajan earned 500 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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

920 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now