Formatting Source HTML Code

User 2026432 Photo


Registered User
13 posts

Unless I've missed something then for me the code formatter is not really working as I would like:

e.g. after formatting/Code Cleaner I have:
<tbody>
<tr>
<th
style="vertical-align: middle; text-align: left; background-color: silver;">
<a href="/index.html">Home Page</a> &nbsp;&nbsp; <a
href="./scan125/index.html">Scan125 Control Program</a> &nbsp;&nbsp; <a
href="scan75/index.html">Scan75 Control Program</a>&nbsp;&nbsp;&nbsp; <a
href="./driver8/index.html">DriveR8 Control Program</a> &nbsp;&nbsp; <a
href="./hf150/index.html">HF150 Control Program</a>&nbsp;&nbsp;&nbsp;&nbsp;
<a href="./if150/index.html">IF150 USB Interface</a>&nbsp;&nbsp;&nbsp;
<a href="./strada_abarth/index.html">Strada/Ritmo Abarth 130TC</a>&nbsp;
&nbsp; <a href="./blog/index.html">My Odd BLOG</a>&nbsp; </th>
</tr>
</tbody>

I would like to see:
<tbody>
<tr>
<th style="vertical-align: middle; text-align: left; background-color: silver;">
<a href="/index.html">Home Page</a> &nbsp;&nbsp;
<a href="./scan125/index.html">Scan125 Control Program</a> &nbsp;&nbsp;
<a href="scan75/index.html">Scan75 Control Program</a>&nbsp;&nbsp;&nbsp;
<a href="./driver8/index.html">DriveR8 Control Program</a> &nbsp;&nbsp;
<a href="./hf150/index.html">HF150 Control Program</a>&nbsp;&nbsp;&nbsp;&nbsp;
<a href="./if150/index.html">IF150 USB Interface</a>&nbsp;&nbsp;&nbsp;
<a href="./strada_abarth/index.html">Strada/Ritmo Abarth 130TC</a>&nbsp;&nbsp;
<a href="./blog/index.html">My Odd BLOG</a>&nbsp;
</th>
</tr>
</tbody>

I note this does note view well in the forum but to clarify then each <tag> and </tag> would be aligned and subsequent next different ones indented.

User 2088758 Photo


Senior Advisor
3,105 posts

Just a couple comments. Why are you still building with tables this is a very dated way of handling tables. I would opt for a grid layout to handle this formatting. If this is supposed to be a menu I would use ul and li elements to build.

Secondly do you have a link to the page? It would be helpful to see what you are trying to achieve.

What software are you using to build your page? SD4 or HTML Editor?

Taking over the world one website at a time!

Steve Kolish
www.misterwebguy.com

YouTube Channel:
https://www.youtube.com/channel/UCL8qVv … ttneYaMSJA
User 2026432 Photo


Registered User
13 posts

Hi Steve

A little background is I guess appropriate.

I started to write web pages in hand grafted HTML long before WYSIWYG editors. By doing so as a programmer I could write and construct my code and layout into well structured and formatted forms.

That was then. I then found Kompozer (and others eg. Frontpage) which was a more easy coding/writing environment.

So most of my HTML code base was updated by Kompozer.

The link to my antiquated site is: https://nick-bailey.co.uk

It will be clear that my site is "basic" / "simple" with no fancy stuff. Yes it does not use (yet) CSS but I just want to have simple headings, contents and links. When I hand created my web pages I used <h1> etc. None of the <span> and other fancy tags.

So to be honest when I used the likes of Front Page, Komposer and others my personal control and coding style was removed from me. At the same time I gained an ease of construction and editing.

If I hand graft say in Notepad++ then I pretty much define my source code layout and view. I can readily see my <h2></h2> and <a></a> all neatly aligned to the eye for rapid validation.

In HTML editor despite reformatting (assuming I've done this correctly) then I see (for example) <a> and </a> split across lines, joined on lines and then split, etc.

So in general HTML Editor is loading the source files created by Kompozer or other files hand created by me. But I find it's structural and format layout in relation to <tag> processing to be rather sporadic/random. It seems to get <body> and </body> aligned but other tags seem to get split up and separated all over the place.

Last point. I've not tried to create a new HTML file from scratch with HTML editor so maybe doing so will fix my issues but if I can randomly type into HTML Editor from scratch and it can format correctly then why can't it do it from a free formatted but correctly <tagged> file?



User 187934 Photo


Senior Advisor
20,239 posts

I wish the code cleaner hand more setting to make your need possible.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 122279 Photo


Senior Advisor
14,547 posts

Nick, you have just in front of the '<a' a couple of &nbsp; which, as you certainly must know, means 'non-breaking space'. I wouldn't wonder about why the tags get split into two lines where the tag itself has a space in such a case.
Ha en riktig god dag!
Inger, Norway

My work in progress:
Components for Site Designer and the HTML Editor: https://mock-up.coffeecup.com


User 2026432 Photo


Registered User
13 posts

Fair point but if I replace/remove the non-breaking spaces then it still get formatted as:

<th style=" vertical-align: middle; text-align: left; background-color: silver;"><a
href="/index.html">Home Page</a> <a target="_blank"
href="./manual/Scan125-Manual.html">Manual</a> <a href="./download">Download</a>
<a href="./comments/index.html" target="_blank">Send
Your Comments</a> <a href="scan125_usage_profile.html"
target="_blank">Usage Profile</a> <a target="_blank"
href="user_comments.html">User Comments</a> <a
href="../donate/index.html">DONATE</a><br>
</th>
User 2088758 Photo


Senior Advisor
3,105 posts

I 100% would suggest a complete rebuild with SD4. To be honest this website would scare me if I were to accidentally click on it while searching on the internet. It looks very spammy and malware ridden even if it is a virus free website.

Coffeecup offeres many free themes that you could use very easily to put the content you have now onto it. With the visual editor in SD4 you will have no problem making changes to it as well.

Taking over the world one website at a time!

Steve Kolish
www.misterwebguy.com

YouTube Channel:
https://www.youtube.com/channel/UCL8qVv … ttneYaMSJA
User 122279 Photo


Senior Advisor
14,547 posts

I wasn't sure how to put it politely, but I agree with Steve.
Ha en riktig god dag!
Inger, Norway

My work in progress:
Components for Site Designer and the HTML Editor: https://mock-up.coffeecup.com


User 2026432 Photo


Registered User
13 posts

WOW

How do you justify that my site would scare you, spam ware, etc.

First of all I use https. (yes this means nothing but it is better than nothing)

Secondly what is it that "triggers" your reaction. If it is just presentation/look/feel/layout then I'm afraid you are being totally biassed and to be honest unfair. If you are looking "under the covers" at the source then this is interesting as the source as there now was generated by Mozilla's Kompozer product.

I'm not a web designer expert and to be honest don't want to be. I'm more focussed on other things, like generating money for Charity.

So your comments actually hurt me a little and make me feel that I should never have asked a simple question about HTML Editors formatting functions.

Anyway this is not about me or my website it is about how HTML Editor handles the formatting of HTML tags and that has nothing to do with anything else.

I honestly expected more from this community.
User 2088758 Photo


Senior Advisor
3,105 posts

Sorry you took offense. As for my bias, there is nothing for me to be bias about. I do not work for Coffeecup I just offer my help people in this community with advise and suggestions with the software.

Of course its just my opinion on the look of your website but I assure you there are many that will feel the same way. I am sorry to offend you of course that was not my intent.

Not sure what else to offer you for advise.

Just my 2 cents for what its worth.
Taking over the world one website at a time!

Steve Kolish
www.misterwebguy.com

YouTube Channel:
https://www.youtube.com/channel/UCL8qVv … ttneYaMSJA

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.