Solved

Making A Line Bold and Indenting

Posted on 2013-01-27
12
322 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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
 
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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Suggested Solutions

All XML, All the Time; More Fun MySQL Tidbits – Dynamically Generate XML via Stored Procedure in MySQL Extensible Markup Language (XML) and database systems, a marriage we are seeing more and more of.  So the topics of parsing and manipulating XM…
Both Easy and Powerful 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.wikipedia.org/wiki/PHP  Very powerful.  But a…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

777 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