473,943 Members | 17,203 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HTML Formatting

Hey

I have a class called page. This class outputs a page in html. Now I have a
function called OutPutHtml

This outputs html, however I want to be able to do this:

outputhtml('<bo dy>
<something');

So I can keep it nice and formatted. But when I do this there are huge gaps
in the html. How can I do this so it formats it?

I hope you get what I mean.
Thanks

--
- Hayden Kirk
iXon LTD

123 Main Street,
Upper Hutt, Wellington,
New Zealand

Phone: +64 4 5279091
Fax: +64 4 5268123
Jul 17 '05 #1
5 1994
Hayden Kirk wrote:
I have a class called page. This class outputs a page in html. Now I have a
function called OutPutHtml

This outputs html, however I want to be able to do this:

outputhtml('<bo dy>
<something');
Outputs
========
<body>
<something
========
So I can keep it nice and formatted. But when I do this there are huge gaps
in the html. How can I do this so it formats it?
Either do some reformatting inside outputhtml() (like stripping extra
spaces, extra lines, ...) or pass it a 'nicer' string:

outputhtml('<ht ml>
<something');
I hope you get what I mean.


Not sure I did, hope so.

You're going to have a hard time trying to write 'nice' PHP that also
outputs 'nice' HTML.

My HTML is mostly very large lines with a "\n" here and there :)
--
--= my mail box only accepts =--
--= Content-Type: text/plain =--
--= Size below 10001 bytes =--
Jul 17 '05 #2
On 2004-02-27, Hayden Kirk <sp**@spam.co m> wrote:
Hey

I have a class called page. This class outputs a page in html. Now I have a
function called OutPutHtml

This outputs html, however I want to be able to do this:

outputhtml('<bo dy>
<something');

So I can keep it nice and formatted. But when I do this there are huge gaps
in the html. How can I do this so it formats it?


The easiest way, is not to care about identation of your tags in your
code. Use output buffering, run tidy to clean up the generated html,
and then output the lot.
--
http://home.mysth.be/~timvw
Jul 17 '05 #3
Hi

Thanks for the reply, can you explain this a bit more, I don't quite get
what you mean, or the functions your talking about.

Thanks

"Tim Van Wassenhove" <eu**@pi.be> wrote in message
news:c1******** *****@ID-188825.news.uni-berlin.de...
On 2004-02-27, Hayden Kirk <sp**@spam.co m> wrote:
Hey

I have a class called page. This class outputs a page in html. Now I have a function called OutPutHtml

This outputs html, however I want to be able to do this:

outputhtml('<bo dy>
<something');

So I can keep it nice and formatted. But when I do this there are huge gaps in the html. How can I do this so it formats it?


The easiest way, is not to care about identation of your tags in your
code. Use output buffering, run tidy to clean up the generated html,
and then output the lot.
--
http://home.mysth.be/~timvw

Jul 17 '05 #4
Hayden Kirk wrote:
"Tim Van Wassenhove" <eu**@pi.be> wrote in message
news:c1******** *****@ID-188825.news.uni-berlin.de...
(...)
The easiest way, is not to care about identation of your tags in your
code. Use output buffering, run tidy to clean up the generated html,
and then output the lot.

(...)
Thanks for the reply, can you explain this a bit more, I don't quite get
what you mean, or the functions your talking about.


Output buffering means, Your script does not output code until it has
finished. In php5, it is possible to have the output sent through Dave
Ragget's HTML Tidy which reformats and cleans Your HTML before it is
sent to the client. (Extension required)

Excellent option, if You already have php5 and the extension installed.
Anybody here has done this already?

I suppose the HTML better not be _too_ bad, otherwise I don't know what
Tidy might do.

Rudi
Jul 17 '05 #5
On 2004-02-27, Hayden Kirk <sp**@spam.co m> wrote:
"Tim Van Wassenhove" <eu**@pi.be> wrote in message
news:c1******** *****@ID-188825.news.uni-berlin.de...
On 2004-02-27, Hayden Kirk <sp**@spam.co m> wrote:
> Hey
>
> I have a class called page. This class outputs a page in html. Now I have a > function called OutPutHtml
>
> This outputs html, however I want to be able to do this:
>
> outputhtml('<bo dy>
> <something');
>
> So I can keep it nice and formatted. But when I do this there are huge gaps > in the html. How can I do this so it formats it?
>
The easiest way, is not to care about identation of your tags in your
code. Use output buffering, run tidy to clean up the generated html,
and then output the lot.

Thanks for the reply, can you explain this a bit more, I don't quite
get
what you mean, or the functions your talking about.


http://www.php.net/manual/en/ref.outcontrol.php

Read also the user comments...

--
http://home.mysth.be/~timvw
Jul 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

27
12073
by: Fuli Chang | last post by:
I don't like other people see my html code. Is there a way to hide it? Thanks.
8
1506
by: Seth | last post by:
How can I completely turn off the auto formatting of Html in Visual Studio 7? I have tried all possible combinations (at least I think I have) of the Tools / Options / Text Editor / HTML XML / Formatting. This is a big annoyance because with a rather large page it can be very time consuming to reformat by hand, and very time consuming to search through and work with the mangled formatting that often happens do switching to the design...
258
8951
by: Terry Andersen | last post by:
If I have: struct one_{ unsigned int one_1; unsigned short one_2; unsigned short one_3; }; struct two_{ unsigned int two_1;
1
1444
by: coder10 | last post by:
Two things 1. Why does ASP.Net not respect code formatting for the HTML tags. I mean, when I write my HTML, I try to use appropriate tabs and spaces and lines beween my tags, but when I save and open in Design View and come back, my HTML view loses all its code formatting. 2. ASP.Net has been inserting "DESGNTIMESP" tags in random places in my HTML view, because of which my pages do not look what they are supposed to look like in design...
10
3183
by: Coleen | last post by:
Hi all :-) I have a weird formatting problem with an HTML table that I am populating using VB.Net and HTML. Here is the snippet of code for the cell I'm trying to format: Dim ld_tot_pet_clean_fee_calc As Double ld_tot_pet_clean_fee_calc = li_net_total_calc * 0.0075 ld_tot_pet_clean_fee = lo_misc_func.FormatMC(ld_tot_pet_clean_fee_calc, "D") Session("tot_pet_clean_fee") = lo_misc_func.FormatMC(ld_tot_pet_clean_fee, "D")...
4
1613
by: Arthur Dent | last post by:
Hello all, ive been programming with ASP.NET since it came out, but am just getting my feet with now with v.2. Ive noticed something strange in the way my HTML tables get rendered with 2. I use tables to layout my pages, doing three rows, a header, content and footer. When i do this, i make the tables height=100%, so the footer always shows up at the very bottom of the page. With 2.0/2005 though, when it renders the pages, it doesnt...
3
9740
by: realmerl | last post by:
Hi All. I'm trying to transform a html document into plain text via xslt. Simple you say! (i hope) I have got it working, by using the magnificent <xsl:value-of select="."/>. This returns the whole document, and <xsl:output method="text"/> ensures that the output I get is plain text. problem: The html I am transforming has a table, with headings and data. Whilst the output contains all the data form the table, it does not preserve any...
3
1974
sanjay123456
by: sanjay123456 | last post by:
Dear friends, <?php //define the receiver of the email $to = 'sanjay.mit@gmail.com'; //define the subject of the email $subject = 'Test HTML email'; //create a boundary string. It must be unique
5
1866
by: Surbhi | last post by:
Hi We have HTML datasheets but now we want then in PDF format because page layout is very bad when HTML is printed. I am through with the XML and XSLT part. But donot hav any idea of XSL- FO. I guess, i would need to use "fo" tags in the XSLT. Could someone suggest me some good reference material, or pointers for this. Its a bit urgent, please do help.
3
3130
by: CJM | last post by:
David, Thanks for the reply. Responses inline: "David E. Ross" <nobody@nowhere.notwrote in message news:OZadnaBdOMGpYb3VnZ2dnUVZ_vOdnZ2d@softcom.net... This is a promotional mailshot so image is important. I understand what you
0
10143
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11539
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9866
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8228
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7393
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6090
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6312
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4913
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3516
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.