Forum Moderators: phranque

Message Too Old, No Replies

Does a program exist which can structure my HTML?

         

budbiss

3:56 pm on Jan 11, 2007 (gmt 0)

10+ Year Member



I am looking for something which can take my sloppy unstructured HTML and make it look nice so that it will be easier for me to edit.

calicochris

4:30 pm on Jan 11, 2007 (gmt 0)

10+ Year Member



I use Dreamweaver (simply because I grew up with it..) Sure, it can help a lot but bad code is bad code. Dreamweaver can out and indent the code, use colors to make certain things stand out, find repeating entries, help you with closing tags and a lot more. I guess most html editors can do these things. But again, bad code is bad code. I guess I'm a little confused about what you mean by 'structure'?

budbiss

5:27 pm on Jan 11, 2007 (gmt 0)

10+ Year Member



Thanks for the comments calicochris. What I mean by structure is this:

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>

jimbeetle

5:48 pm on Jan 11, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



There are quite a few HTML editors out there with varying features. TextPad and HTML-Kit come up quite often for this topic, but with a couple of simple searches you should be able to find one that fits the way you work.

bateman_ap

5:50 pm on Jan 11, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



budbiss, Dreamweaver does that for you via a menu option called "Apply Source Formatting"

phranque

12:53 am on Jan 12, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



check out HTML Tidy, which is a w3c product.
[w3.org...]

rocknbil

8:52 am on Jan 12, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



<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.

engadven

3:42 pm on Jan 12, 2007 (gmt 0)

10+ Year Member



If you're using tables then you should throw the code away and start again from scratch.
If you don't what to learn to code perfectly then just install a CMS and copy and paste the text into that. No need to use Dreamweaver or any other editor these days unless you want to learn to code.

budbiss

10:00 pm on Jan 12, 2007 (gmt 0)

10+ Year Member



So, table seems to be a bad word nowadays ;)

Thanks for the suggestions guys! I'll try textpad first since I already have it. And that Tidy app sounds like it will work too. This is actually just for snippits of html for our site's product pages.

g1smd

4:02 pm on Jan 15, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



It is one thing to have code laid out nice, and quite another for the HTML code to be lean, optimum and correct.

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.

jomaxx

6:48 pm on Jan 15, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I just write the HTML in the same intuitive format that I can easily comprehend and edit it in.

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).