Jump to content

problem in alignment


lak

Recommended Posts

hi,i m doing one billing software, in which i m using Mysql database, php design, and javascript.While run that page, there is alignnment problem. the other thing is the line after the database term is aligning on next line.Wherever the database term, the next word to that database term is aligning on next line.Because of this, there was a great alignment problem, not able to get continous text format as paragraph.PLs gice suggestion for this at the earliest,.........

Link to comment
Share on other sites

Umm... if you have a problem, please post the code. Or else we are completely in the dark. Are you sure you didn't accidentally echo a <br /> tag?

Link to comment
Share on other sites

Umm... if you have a problem, please post the code. Or else we are completely in the dark. Are you sure you didn't accidentally echo a <br /> tag?
this is the coding:
<table width="650" height="495" border="0" align="center" cellpadding="0" cellspacing="0">  <tr>    <td colspan="9"><form action="../../billofexchange/word1.php" method="post">      <div align="center"></div>    </form></td>  </tr>  <tr>    <td height="125" colspan="9"><div align="left"><img src="ScannedImage12-NEW.jpg" width="650" height="103" /><br />    </div></td>  </tr>  <tr>    <td height="9" colspan="3"><div align="center"><span class="style5 style1" style="text-decoration:underline"><strong>BILL OF EXCHANGE</strong></span>            <?php $string = $row['billno'];$token = strtok($string,",");while ($token !== false)  {  echo "$token<br />";  $token = strtok("");  }?>    </div></td>  </tr>  <tr>    <td height="10" colspan="3"> </td>  </tr>  <tr>    <td width="374" height="1">This bill of exchange is drawn under invoice No.     <?php $string = $row['invoicenumber'];$token = strtok($string,",");while ($token !== false)  {  echo "$token<br />";  $token = strtok("");  }?></td>    <td width="125">dated     <?php $string = $row['predate'];      $token = strtok($string,",");      while ($token !== false)  {  echo "$token<br />";  $token = strtok("");  }?></td>    <td width="151">for Rs.<?php $string = $row['invoiceamount'];$token = strtok($string,",");while ($token !== false)  {  echo "$token<br />";  $token = strtok("");  }?></td>  </tr>  <tr>    <td height="1" colspan="3"> </td>  </tr>  <tr>    <td height="2" colspan="3"><span class="style7">To</span></td>  </tr>  <tr>    <td height="5" colspan="3"> </td>  </tr>  <tr>    <td height="10" colspan="3"><?php $string = $row['address'];$token = strtok($string,",");while ($token !== false)  {  echo "$token<br />";  $token = strtok("");  }?></td>  </tr>  <tr>    <td height="19" colspan="3"> </td>  </tr>  <tr>    <td height="1" colspan="3"><span class="style2">Amount - Rs.</span>      <?php $string = $row['invoiceamount'];$token = strtok($string,",");while ($token !== false)  {  echo "$token<br />";  $token = strtok("");  }?></td>  </tr>  <tr>    <td height="19" colspan="3" valign="middle"> </td>  </tr>  <tr>    <td height="19" colspan="3"><div align="center">Due Date :        <?php $string = $row['duedate'];$token = strtok($string,",");while ($token !== false)  {  echo "$token<br />";  $token = strtok("");  }?></div></td>  </tr>  <tr><td height="17" colspan="3"><table width="600" border="0" cellspacing="0" cellpadding="0">      <tr>        <td colspan="3"> </td>      </tr>      <tr>        <td width="106">At                       <?php $string = $row['duedays1'];$token = strtok($string,",");while ($token !== false)  {  echo "$token<br />";  $token = strtok("");  }?></td>        <td width="84">(          <?php $string = $row['dueday'];$token = strtok($string,",");while ($token !== false)  {  echo "$token<br />";  $token = strtok("");  }?>)</td>        <td width="460">  days  from  date  of  this  bill  of  exchange,  (including  days  of  grace,  if    </td>      </tr>      <tr>        <td colspan="3">  any)  pay  to  Indian  Bank,  Royapettah  Branch.  Or  order  the  sum  of  Rupees <strong>          <?php $string = $row['rupee'];$token = strtok($string,",");while ($token !== false)  {  echo "$token<br />";  $token = strtok("");  }?>        </strong></td>      </tr>      <tr>        <td colspan="3"><div align="right">          <table width="319" border="0" cellspacing="0" cellpadding="0">            <tr>              <td>for value received. </td>            </tr>          </table>        </div></td>      </tr>      <tr>        <td colspan="3"> </td>      </tr>      <tr>        <td colspan="3"> </td>      </tr>      <tr>        <td colspan="3">This  bill  of  exchange  is  drawn  in  connection  with  the  sale  of  goods  to  you  by  us  as  per  the </td>      </tr>      <tr>        <td colspan="3"> following   invoice:</td>      </tr>      <tr>        <td colspan="3"> </td>      </tr>      <tr>        <td colspan="3"><table width="650" border="0" cellspacing="0" cellpadding="0">          <tr>            <td width="311">INVOICE NO:               <?php $string = $row['invoicenumber'];$token = strtok($string,",");while ($token !== false)  {  echo "$token<br />";  $token = strtok("");  }?></td>            <td width="339"><div align="center">INVOICE DATE :                 <?php $string = $row['invoicedate'];$token = strtok($string,"");while ($token !== false)  {  echo "$token<br />";  $token = strtok(",");  }?>            </div></td>          </tr>          <tr>            <td colspan="2"> </td>          </tr>          <tr>            <td colspan="2">INVOICE AMOUNT <strong>:</strong>              <?php $string = $row['invoiceamount'];$token = strtok($string,",");while ($token !== false)  {  echo "$token<br />";  $token = strtok("");  }?></td>          </tr>          <tr>            <td colspan="2"> </td>          </tr>          <tr>            <td><div align="left">For Drawer</div></td>            <td><div align="right">ACCEPTED FOR PAYMENT </div></td>          </tr>          <tr>            <td colspan="2"> </td>          </tr>          <tr>            <td colspan="2"> </td>          </tr>          <tr>            <td><div align="left">Authorised Siognatory </div></td>            <td><div align="center">                                  Authorised Siognatory </div></td>          </tr>          <tr>            <td colspan="2"> </td>          </tr>        </table></td>      </tr>    </table></td>  </tr></table>

Link to comment
Share on other sites

You're tokenizing everything that comes out of the database and writing each token on its own line. Is that what you're trying to do?
as i m new to this thing, i tried my level best, could't you explain to my level.
Link to comment
Share on other sites

I'm not sure what your level is, I'm just going by what's in the code. You have blocks of code like this:

<?php $string = $row['billno'];$token = strtok($string,",");while ($token !== false){  echo "$token<br />";  $token = strtok("");}?>

What are you trying to do with that? The strtok function "tokenizes" a string, that means it looks for tokens (pieces) that are separated by a given character. You first tokenize it with a comma, so it will return the part of the string before the first comma, or if the comma is the first character it will return from that until the next comma or the end of the string. It displays that, then it outputs a line break and outputs the rest of the string. So it outputs anything before a comma on one line, and everything else after it on the next line. That's what that loop is doing, there is a structure like that for most database fields.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...