Menu

paragraph tags height

Help
2017-09-05
2017-09-06
  • Michelle Mike

    Michelle Mike - 2017-09-05

    I am generating an invoice with the values from database. Product drecription is stored with html tags, in that

    tag is also included. When i generate data in table, whereever i have

    tags its leaving very much space. Is there anywhere i can decrease this space(line height only for

    tag?. I can share the code if needed. But plz suggest me on this

     
  • Michelle Mike

    Michelle Mike - 2017-09-06

    no one has got this problem??????

     
  • Simon

    Simon - 2017-09-06

    The html has been stripped by the message board so we don't even know what your problem is.

    Please provide the minimum amount of code to demonstrate your problem.

    And please use the code tags
    
     
  • Michelle Mike

    Michelle Mike - 2017-09-08

    I am displaying data from database in table format like this

    $pdf->SetMargins(8,27,8);
    $pdf->SetHeaderMargin(5);
    $pdf->SetFooterMargin(7);
    
    function fetch_data()
    {
    $output = '';  
        include('../connect.php');
    
        //  $sql = My sql query to extract data;
    
    $query = mysqli_query($con, $sql) or die (mysqli_error($con));  
    
    $total_amt = 0;
    $tax_amt = 0;
    $i=1;
    while($row = mysqli_fetch_array($query)) { 
    
    $output .= '<tr>
    <td>'.$i.'</td>   
                              <td>'.$row["product"].' - '.$row['description'].'</td>
                               <td>'.$row["code"].'</td>  
                              <td>'.$row["quantity"].' - '.$row['uom'].' </td>                     
                              <td ">'.$row["price"].'</td>  
                              <td>'.$row["discount"].'</td>  
                              <td>'.$row["tname"].' - '.$row['rate'].' %</td>
                              <td>'.$row["sub_total"].'</td>    
                         </tr>  
                              ';  
                              $total_amt += $row['sub_total']; 
          $tax_amt += $row['tax_amount'];
          $i++;
          } 
    
    $output .= '<tr><td colspan="6" align="left">Sub-Total</td><td align="center">'.number_format($tax_amt,2).'</td><td>'.number_format($total_amt,2).'</td></tr>';
    
    $output .= '<tr><td colspan="6"></td><td align="center">Total</td><td align="right">'.number_format($total_amt+$tax_amt,2).'</td></tr>';
    
          return $output;
    }
    
    $content .= '  
          <table border="0"><tr><td width="100%">
          <table border="0">
               <tr>' ;
             $pdf->SetFont('arsenal', '', 12);  
    
     $content .= '
            <th><b>#</b></th>  
                    <th><b>Item & Description</b></th>
                    <th><b>Code Value</b></th>  
                    <th><b>Qty.</b></th>  
                    <th><b>Rate</b></th> 
                    <th><b>Disc%</b></th> 
                    <th><b>Tax</b></th>  
                    <th><b>Amount</b></th>  
               </tr>   ';  
          $content .= fetch_data();  
          $content .= '</table></td></tr> 
          </table>';
    
    $pdf->writeHTML($content);  
    

    But my product description is stored with

    tags.
    while displaying i get some extra space between these 2 paragraphs like in attached file

    Where i can correct it? can u please suggest?

     

    Last edit: Michelle Mike 2017-09-08
  • Michelle Mike

    Michelle Mike - 2017-09-15

    @Simon: I have provided the code, still no support?

     
  • Simon

    Simon - 2017-09-15

    I was suggesting your provide code that shows your fault, that I can run. I can't see your generated code when you use db variables.

    However it seems you have a field with html that ruins your layout?

    Have you tried using PHPs strip_tags()?

     
  • Michelle Mike

    Michelle Mike - 2017-09-16

    My problem area is $row['description'], here i display description with html tags. Only for

    tags, its is taking huge space between each para. So if i use strip_tags(), even the

    tags doesn't work.

     
  • Simon

    Simon - 2017-09-16

    You need to use code tags every time you post code else I can't see it.

    You also need to post code I can run that shows your problem.

    Try writing a basic page that doesn't do anything with your database, that runs standalone and demonstrates your problem. Then share this page and pdf and people can use it to help you.

     

Log in to post a comment.