How do I remove blank lines from HTML?

I want to remove the blank lines between my HTML and PHP code when I view source it you can see where the PHP code goes. I want to change this.
<table>
         <tr>
            <th align='right'>Service Area:</th>
            <th align='right'>Union</th>

            <th align='right'>South Carolina</th>


         </tr>
   </table>
to this
<table>
         <tr>
            <th align='right'>Service Area:</th>
            <th align='right'>Union</th>
            <th align='right'>South Carolina</th>
         </tr>
       </table>

Comments

  • The first PHP-tags is how you should not to it, and the second is how you should place them to avoid blank lines:
    <table>
      <tr>
        <th align='right'>Service Area:</th>
        <th align='right'>Union</th>
    <?php
     // like this you will get a blank line
    ?>
        <th align='right'>South Carolina</th><?php
     // likes this you will only get one new line
    ?>
      </tr>
    </table>
    
Sign In or Register to comment.