[thelist] unwanted spacing on expanded TDs

Lee kowalkowski lee.kowalkowski at googlemail.com
Tue Aug 15 04:26:05 CDT 2006


On 14/08/06, Daniel Kessler <danielk at umd.edu> wrote:
> Clearly I can code in the way that deletes whitespace and doesn't
> produce a problem, but that makes my lines hundreds of characters
> long, especially since this is a simple example.  That's unwieldy and
> difficult to edit.
>
> I thought whitespace was ignored.

Whitespace between tag elements is generally not ignored, it's
considered content, but condensed to a single space, depending on the
type of element that contains the whitespace.

Whitespace inside element tags (between attributes) is never rendered,
so you can make some code readability enhancements here.

So you can still format your code so it's easier to edit.  Perhaps like this:

<tr>
  <td><!--
    --><a href="career_services.cfm"><!--
      --><img
           src="../images/nav_career_services.gif"
           alt="Career Services"
           name="career_services"
           width="92"
           height="59"
           border="0"
           id="career_services"
           onMouseUp="MM_swapImgRestore()"
           onMouseOver="MM_swapImage('career_services', '',
'../images/nav_career_services_r.gif', 1)"
           onMouseOut="MM_swapImgRestore()"
         ><!--
    --></a>
  </td>
</tr>

Although I hate commenting out whitespace, It's not as bad if you can
use server-side comments.

-- 
LK



More information about the thelist mailing list