Forum Moderators: phranque
Bad structure:
<html><table><tr><td>abc1
</td><td>abc2 </td> </tr> </table></html>
Good structure:
-----<html>
-----<table>
----------<tr>
----------<td>
---------------abc1
----------</td>
----------<td>
---------------abc2
----------</td>
----------</tr>
-----</table>
-----</html>
<html><table><tr><td>abc1
</td><td>abc2 </td> </tr> </table></html>
Well there's your problem right there, using tables for layout! :-)
< Spoken by a table junkie - had to get that in there before the purists did. :-) >
A thread last week [webmasterworld.com] asked the exact same question - and the answer was also HTML Tidy. It's notable to mention HomeSite has a built-in version of HTML Tidy, as well as six other "CodeSweepers" specific to document types.
I always build pages using headings, paragraphs, lists, tables, forms, and images, and make sure that all block-level elements are correctly closed, and that all element nesting is correct. I use CSS to style the major blocks and then add class names to any exceptions (such as the navigation list, or the footer paragraph).
That part is important too.
FWIW, a partner company of mine uses this sort of thing, and the wasted space due to excessive tabs and unnecessary line breaks literally amounts to almost 50% of the page file size. Very wasteful. I told them about this years ago after I happened to look at their source code, but they can't be bothered to optimize it. Instead they'd rather have every pageview for every user take twice as long as necessary (AFAIK they are not using compression either).