How do I remove blank lines from HTML?

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

      HTML Source Code

      1. <table>
      2. <tr>
      3. <th align='right'>Service Area:</th>
      4. <th align='right'>Union</th>
      5. <th align='right'>South Carolina</th>
      6. </tr>
      7. </table>

      to this

      HTML Source Code

      1. <table>
      2. <tr>
      3. <th align='right'>Service Area:</th>
      4. <th align='right'>Union</th>
      5. <th align='right'>South Carolina</th>
      6. </tr>
      7. </table>

      The post was edited 1 time, last by godson4 ().

    • The first PHP-tags is how you should not to it, and the second is how you should place them to avoid blank lines:

      HTML Source Code

      1. <table>
      2. <tr>
      3. <th align='right'>Service Area:</th>
      4. <th align='right'>Union</th>
      5. <?php
      6. // like this you will get a blank line
      7. ?>
      8. <th align='right'>South Carolina</th><?php
      9. // likes this you will only get one new line
      10. ?>
      11. </tr>
      12. </table>
      Display All