Yes folks, there is an easier way.
It’s common knowledge that whitespace in HTML code creates unnecessarily larger file sizes, increases bandwidth usage and slows down page load time. The only real reason to add whitespace to your code is for organization, but I have rarely found that helpful. Many HTML editors take the liberty of adding massive amounts of whitespace to your code for you. I guess they aren’t thinking about the real world.
Okay, just in case you don’t know what I mean, I’ll give you an example.
Below is a sample HTML table I just set up using Dreamweaver:
Do you see those unnecessary spaces before the TR and TD tags? Yup, that’s whitespace. Each one of those little spaces makes your web page larger.
So, how do you get rid of all that whitespace without going through all your code and making use of your delete key? It’s easy. I recently found a website called “Design215 Whitespace Remover” that does exactly that…and fast.
All you do is copy and paste your HTML code in the top white box and click on the “Compress” button. The tool removes all the whitespace in the code and shows the result in the bottom box. Copy and paste that code and you’re all set.
Here is what it did to the above code when I compressed it: