Solution 1: Add comments:
<div class="tr" style="width: 150px;">
<div class="td" style="width: 50px; background-color: #CCC;"></div><!--
--><div class="td" style="width: 50px; background-color: #AAA;"></div><!--
--><div class="td" style="width: 50px; background-color: #666;"></div>
</div>
You can write everything on the same line, too, but it looks cleaner with comments.
Solution 2: Add font-size:0
to the parent element. Don't forget to define the font-size for child elements:
.tr {
font-size: 0;
}
.td {
font-size: 15px;
}