Re: Netscape and and tables

by =?iso-8859-1?Q?St=E9phane?= Bergeron <stephberg(at)videotron.ca>

 Date:  Sun, 11 Jun 2000 01:47:07 -0400
 To:  hwg-techniques(at)hwg.org
 In-Reply-To:  default
  todo: View Thread, Original
At 09:34 PM 10/06/00 -0400, you wrote:
> >Does anyone know any tips that may be of help?
>
>hi susan
>however, to avoid this problem, you do not have to code everything all one
>one line -- just remove the line break and tab that are between the closing
>">" of the img tag and the opening "<" of the /td tag
>
>naturally, most people think this implies you have to code it all on one
>very long line, but it doesn't
>
>lemme tellya, those long lines of code are a real pain if you're trying to
>read the actual code, to say nothing of what it's like to maintain or even
>understand code that's written like that

Yeah, it's a good trick indeed and I was aware of it but it just looks=20
weird to me and I am pretty anal when it comes to keeping code as free from=
=20
unnecessary spaces and line feeds to keep files as small as=20
possible.  That's why I always indent with tabs instead of spaces too.  But=
=20
that's all just a personal preference.  I don't mind long lines in my code=
=20
myself because the editors I use (HomeSite 4.5.1 and NoteTab Pro 4.82 as=20
well as the HTML inspector in Dreamweaver) insert "soft" returns in the=20
code when they display it (it's an option in both programs and many others)=
=20
so I never have to scroll long lines sideways.

>of course, if you're using a wysiwyg editor, there's a good chance you
>don't care what kind of code you get -- no flames, please, i do realize
>that some very competent code jockeys use dreamweaver...  well, maybe just
>to get a page started...  ;o)
>
>[aside: dreamweaver's actually pretty darned good, there's another product
>that shall remain nameless that should really be called wygiwyd -- what you
>get is what you deserve]

hehehe... agreed... ;-)  And btw, if you edit Dreamweaver's=20
"SourceFormat.txt" file, you can get it to format your code just about any=
=20
way you like.  I got it to format code pretty damn close to how I do it by=
=20
hand.  In any case I've had a lot more success with it than with HomeSite's=
=20
CodeSweeper.


>anyhow, to make a long story short -- i know, i know, it's already too late
>for that -- here's the tip
>
>break the line *inside* a tag
>
>for example
>
>     <td
>     ><img src=3Dfoo.gif
>     ></td>
>
>looks weird, right?  perfectly valid
>
>it's quite clean and neat and more practical -- to me, anyway

Yep, and some people also like to separate all attributes on their own line=
=20
like for example:

<img src=3D"foo.gif"
         width=3D"200"
         height=3D"80"
         border=3D"0"
         alt=3D"whatever">

All of it's good as long as you keep in mind that Netscape doesn't like=20
spaces and hard returns between tags inside table cells.  The spec says=20
that browsers should ignore hard returns and extra spaces in HTML code but=
=20
Netscape doesn't for reasons only known to them...

Cheers!

St=E9phane Bergeron

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA