• Welcome to the new forum! We upgraded our forum software with a host of new boards, capabilities and features. It is also more secure.
    Jump in and join the conversation! You can learn more about the upgrade and new features here.

Help with an HTML Report

blackcows

Brewer
Joined
Dec 14, 2006
Messages
35
Reaction score
0
I have made a custom report which allows me to print a 4 x 6 report on photo paper which you can see here:

beer9.JPG


If you notice on the label furthest to the left the name is very close to both sides.  I have changed some of the names so that they are shorter but don't want to have to name beers based on what will fit on my labels.  What I would like to be able to do is somehow force the $NAME variable to do a word wrap if it is too long.  Is this possible?  Here is my code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<table width="400" height="600" border="0" cellspacing="0">
  <tr>
    <td width="20%" bgcolor="#000000"><div align="center"><b><strong><font color="#999999" size="+2" face="Copperplate Gothic Bold">Now
        Serving :</font></strong></b></div></td>
  </tr>
  <tr>
    <td height="152" bgcolor="#999999"><div align="center">
<table width="80%">
          <tr>
            <td><strong><nobr><b><font size="+2" face="Copperplate Gothic Bold">
              <div align="center">$NAME</div>
              </font></b></nobr> </strong>
              <div align="center"><strong><font size="+2"></font></strong></div>
              </td>
          </tr>
        </table>
        <p><strong><font size="+2">

          <font size="+1">Style:</font>

          <nobr><font size="+1">$STYLE_NAME</font></nobr></font>

          <nobr></nobr> <nobr></nobr></strong></p>
      </div></td>
  </tr>
  <tr>
    <td height="102" bgcolor="#999999"><div align="center">
        <p><strong><font size="+2">Brewed On</font></strong><font size="+2">

          $DATE</font></p>
        <p><font size="+2"><strong>ABV </strong>$ABV</font></p>
      </div></td>
  </tr>
  <tr>
    <td height="180" bgcolor="#999999"><div align="center"><img src="file:///C|/Documents%20and%20Settings/Owner/Desktop/barley.jpg" width="81" height="120"></div></td>
  </tr>
  <tr>
    <td bgcolor="#000000"> </td>
  </tr>
</table>
</body>
</html>
 
Hmm,
  About the only thing I can think of is to embed the name within a table cell that is narrow enough so it forces a word wrap if the name is too large.

Cheers!
Brad
 
You have <nobr> causing your problem. <nobr> means "no break" which was forcing everything to be on the same line.

You have:

<td><strong><nobr><font size="+2" face="Copperplate Gothic Bold">
              <div align="center">$NAME</div>

Change to:

<td><strong><font size="+2" face="Copperplate Gothic Bold">
              <div align="center">$NAME</div>

I tested this and it solves your problem.

Nice template idea. Thanks for sharing.

Cheers!

John

 
Back
Top