Solved

Making A Line Bold and Indenting

Posted on 2013-01-27
12
319 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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Introduction In this article, I will by showing a nice little trick for MySQL similar to that of my previous EE Article for SQLite (http://www.sqlite.org/), A SQLite Tidbit: Quick Numbers Table Generation (http://www.experts-exchange.com/A_3570.htm…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

743 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

12 Experts available now in Live!

Get 1:1 Help Now