Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bloated HTML using HTML::Template 2

Status
Not open for further replies.

audiopro

Programmer
Apr 1, 2004
3,165
GB
I have an app which uses a fairly complex template.
I have made the template easier to read by tabbing the content. Unfortunately, the tabs are reflected in the final HTML resulting in a page which contains a lot of white space.
Is there any way to reduce the amount of white space whiloe still keeping the template readable?

Keith
 
Hello,

In fact I was trying to do exactly this earlier today.

I was unable to find a way to reduce the white space whilst keeping the template readable. I decided that it is much more important to keep the template readable than worry about the "source" of the HTML page.

I noticed this module: but didn't really look into it much, is this the solution?

Chris
 
Perhaps I'm missing the point here, but surely adding tabs to the template just adds tabs to the rendered HTML? And although a tab looks like 8 bytes of spaces on the screen (or more or less, depending on your editor settings), it's only actually one byte in the rendered HTML data?

Do you really have a serious bloat problem, or does it just look as though you have when you see the HTML source in your editor? Edit the actual HTML output, and just do a global find/replace of tab to see how many there are, after which you should be able to see the real scale of the problem.

Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::perlDesignPatterns)[/small]
 
Thanks to you both Chris and Steve.

I am not unduly worried about the additional tabs in the source code but this particular client is a voluntary member of the HTML Police. He was looking at the source code, he was seeing large blank areas and was concerned about bandwidth.

I too think that having a neat appearance of the template is more important than a thousand additional tabs.


Keith
 
Well, you could always keep the tabs in your template that you keep in CVS, and use a little script to strip them out during deployment. Then they are easy to maintain.

But that bothers me vaguely from a testing perspective...

Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::perlDesignPatterns)[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top