| | |
How to render a formatted output using HTML?
Please support our HTML and CSS advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Sep 2006
Posts: 116
Reputation:
Solved Threads: 0
I have developed an application in VB.NET console application.
when i open a particular file suppose txt(Notepad) file then it shows it as it is when i see the
output on console but when i render it to the HTML
then the output is unformatted i.e. it does not understand the format and gives the output like
some special character for example
1> ÿ ÿ (these are the special characters) Regards,
2> for hyperlink it shows the output as HYPERLINK "http://...........com
i want to display the output in a formatted way on the HTML page.
Can anybody have any idea abt this?
when i open a particular file suppose txt(Notepad) file then it shows it as it is when i see the
output on console but when i render it to the HTML
then the output is unformatted i.e. it does not understand the format and gives the output like
some special character for example
1> ÿ ÿ (these are the special characters) Regards,
2> for hyperlink it shows the output as HYPERLINK "http://...........com
i want to display the output in a formatted way on the HTML page.
Can anybody have any idea abt this?
Html has several tag pairs tags for this purpose:
code, kbd, pre, samp, tt, var
code is an inline pair of tags used to show computer code
kbd i an inline pairs used to represent keyboard input.
pre is for preformatted text. It is a block version of code
They render everything between them exactly as written, including indenting. It renders as:
samp is inline for printer output
tt is for teletype in a monospace font
var is inline for a variable
All of these are in the xhtml standard as well as the html.
samp shows printer output.
code, kbd, pre, samp, tt, var
code is an inline pair of tags used to show computer code
kbd i an inline pairs used to represent keyboard input.
HTML and CSS Syntax (Toggle Plain Text)
<kbd>C:> diskcopy a: b:</kbd>
pre is for preformatted text. It is a block version of code
HTML and CSS Syntax (Toggle Plain Text)
<pre> for i=1 to 10 print i, a[i] next i </pre>
They render everything between them exactly as written, including indenting. It renders as:
HTML and CSS Syntax (Toggle Plain Text)
for i=1 to 10 print i, a[i] next i
samp is inline for printer output
HTML and CSS Syntax (Toggle Plain Text)
<samp> Account Total 0001245 $ 12.45 0001365 $ 67.21 0002435 $ 0.00 </samp>
tt is for teletype in a monospace font
var is inline for a variable
All of these are in the xhtml standard as well as the html.
samp shows printer output.
Last edited by MidiMagic; Feb 9th, 2007 at 3:50 pm.
Daylight-saving time uses more gasoline
•
•
Join Date: Sep 2006
Posts: 116
Reputation:
Solved Threads: 0
•
•
•
•
Html has several tag pairs tags for this purpose:
code, kbd, pre, samp, tt, var
code is an inline pair of tags used to show computer code
kbd i an inline pairs used to represent keyboard input.
HTML and CSS Syntax (Toggle Plain Text)
<kbd>C:> diskcopy a: b:</kbd>
pre is for preformatted text. It is a block version of code
HTML and CSS Syntax (Toggle Plain Text)
<pre> for i=1 to 10 print i, a[i] next i </pre>
They render everything between them exactly as written, including indenting. It renders as:
HTML and CSS Syntax (Toggle Plain Text)
for i=1 to 10 print i, a[i] next i
samp is inline for printer output
HTML and CSS Syntax (Toggle Plain Text)
<samp> Account Total 0001245 $ 12.45 0001365 $ 67.21 0002435 $ 0.00 </samp>
tt is for teletype in a monospace font
var is inline for a variable
All of these are in the xhtml standard as well as the html.
samp shows printer output.
but still this problem is not solved the special character and HYPERLINK
1> ÿ ÿ (these are the special characters) Regards,
2> for hyperlink it shows the output as HYPERLINK "http://...........com
I am searching for more attributes of <pre></pre>
but i m not getting how to remove special characters and all garbage things?
For the 'special characters' you might want to try escaping them into HTML entities; or using a different page encoding.
If you don't have too many 'special characters' you can escape them as according to the following table:
http://www.htmlhelp.com/reference/html40/entities/
(There's 3 page of tables [lots of special characters])
If you need to change the encoding (you're using a non-latin character set and, in that case, you have loads of 'special characters') check this out ..
http://www.w3.org/TR/html4/charset.html#h-5.2.1
I'm not sure about the HYPERLINK question.
If you don't have too many 'special characters' you can escape them as according to the following table:
http://www.htmlhelp.com/reference/html40/entities/
(There's 3 page of tables [lots of special characters])
If you need to change the encoding (you're using a non-latin character set and, in that case, you have loads of 'special characters') check this out ..
http://www.w3.org/TR/html4/charset.html#h-5.2.1
I'm not sure about the HYPERLINK question.
Plato forgot the nullahedron..
•
•
Join Date: Sep 2006
Posts: 116
Reputation:
Solved Threads: 0
•
•
•
•
For the 'special characters' you might want to try escaping them into HTML entities; or using a different page encoding.
If you don't have too many 'special characters' you can escape them as according to the following table:
http://www.htmlhelp.com/reference/html40/entities/
(There's 3 page of tables [lots of special characters])
If you need to change the encoding (you're using a non-latin character set and, in that case, you have loads of 'special characters') check this out ..
http://www.w3.org/TR/html4/charset.html#h-5.2.1
I'm not sure about the HYPERLINK question.
Are there any other options to do the same?
I have studied the special characters i.e. the Latin encoding i have replace tht "ÿ" character but it is not get replaced! Now this character is annoying me!
I think I misunderstood your original question.
If you're output when viewing a page in the browser is plain text (i.e. not formatted at-all as HTML), then there's a couple of potential reasons:
- the page isn't saved with an extension that maps to the HTML mime type (*.html, *.htm are good choices; *.txt is not). EDIT: if your page is created from a VB.NET application, ignore that reason.
- the page is being sent with an incorrect Content-Type header (a correct Content-Type is text/html, a bad one is text/plain)
Do you have an accessible (online) version of the page?
If you're output when viewing a page in the browser is plain text (i.e. not formatted at-all as HTML), then there's a couple of potential reasons:
- the page isn't saved with an extension that maps to the HTML mime type (*.html, *.htm are good choices; *.txt is not). EDIT: if your page is created from a VB.NET application, ignore that reason.
- the page is being sent with an incorrect Content-Type header (a correct Content-Type is text/html, a bad one is text/plain)
Do you have an accessible (online) version of the page?
Last edited by MattEvans; Feb 13th, 2007 at 12:51 am.
Plato forgot the nullahedron..
•
•
Join Date: Sep 2006
Posts: 116
Reputation:
Solved Threads: 0
•
•
•
•
I think I misunderstood your original question.
If you're output when viewing a page in the browser is plain text (i.e. not formatted at-all as HTML), then there's a couple of potential reasons:
- the page isn't saved with an extension that maps to the HTML mime type (*.html, *.htm are good choices; *.txt is not). EDIT: if your page is created from a VB.NET application, ignore that reason.
- the page is being sent with an incorrect Content-Type header (a correct Content-Type is text/html, a bad one is text/plain)
Do you have an accessible (online) version of the page?
<META http-equiv='Content-Type' content='text/html; charset=ISO-8859-1'>
i m giving this tag !
That isn't neccessarily enough.
The Content-type header is truely specified in the head of a HTTP response, not the head of the HTML page. That META tag might result in some subtle changes to a page as it's rendered as HTML, but infact, a page has to be interpretted as (at-least) XML for that META tag to ever get processed.
If your server is sending a HTTP response header of text/plain, followed by HTML code; your page will not be rendered or processed as HTML.
If you could be clearer in your problem (an online example would be useful), then it would be easier to understand what's actually happening.
The Content-type header is truely specified in the head of a HTTP response, not the head of the HTML page. That META tag might result in some subtle changes to a page as it's rendered as HTML, but infact, a page has to be interpretted as (at-least) XML for that META tag to ever get processed.
If your server is sending a HTTP response header of text/plain, followed by HTML code; your page will not be rendered or processed as HTML.
If you could be clearer in your problem (an online example would be useful), then it would be easier to understand what's actually happening.
Plato forgot the nullahedron..
•
•
Join Date: Sep 2006
Posts: 116
Reputation:
Solved Threads: 0
•
•
•
•
I think I misunderstood your original question.
If you're output when viewing a page in the browser is plain text (i.e. not formatted at-all as HTML), then there's a couple of potential reasons:
- the page isn't saved with an extension that maps to the HTML mime type (*.html, *.htm are good choices; *.txt is not). EDIT: if your page is created from a VB.NET application, ignore that reason.
- the page is being sent with an incorrect Content-Type header (a correct Content-Type is text/html, a bad one is text/plain)
Do you have an accessible (online) version of the page?
![]() |
Similar Threads
- How to render a formatted output using HTML? (ASP.NET)
- How to render a formatted output using VB.NET? (VB.NET)
Other Threads in the HTML and CSS Forum
- Previous Thread: HTML table vertical aligning problem
- Next Thread: I need help with this, please anyone?
| Thread Tools | Search this Thread |
appointments asp background backgroundcolor beta browser bug calendar cart cgi code codeinjection corporateidentity css design development displayimageinsteadofflash dreamweaver emailmarketing epilepsy explorer firefox flash form format google griefers hackers hitcounter hover html ide ie7 ie8 iframe image images internet internetexplorer intranet iphone javascript jpeg layout macbook maps marketshare microsoft mozilla multimedia navigationbars news offshoreoutsourcingcompany opacity opera optimization pnginie6 positioning problem scroll seo shopping studio swf swf. textcolor timecolor titletags url urlseparatedwords visual visualization web webdevelopment webform website windows7






