<?php
$html = '<tr> <td>A </td> <td>B </td> <td>C </td> </tr>';
$html = preg_replace('~(</td>)([\s]+)(<td>)~', '$1$3', $html);
$html = preg_replace('~(<tr>)([\s]+)(<td>)~', '$1$3', $html);
echo preg_replace('~(</td>)([\s]+)(</tr>)~', '$1$3', $html);