Click here to Skip to main content
Full site     10M members (26.3K online)    

Formatting code in Tips and Tricks

Code in Tip/Trick Posts should wrapped with <pre> </pre> tags to ensure formatting and colouring are correct.

 

For example:

 

<pre lang = "vb">
' Example  
Dim test As String
</pre>
will produce:

' Example
Dim test As String
 

To specify the programming language, use lang="xxx" as follows:

 

<pre lang = "C++"> for Native C++ Formatting
<pre lang = "mc++"> for C++/CLI Formatting
<pre lang = "aspnet"> for ASP.NET Formatting
<pre lang = "cs"> forC# Formatting
<pre lang = "css"> for CSS Formatting
<pre lang = "F#"> for F# Formatting
<pre lang = "html"> for HTML Formatting
<pre lang = "Java"> for Java Formatting
<pre lang = "jscript"> for JavaScript Formatting
<pre lang = "asm"> for MASM/ASM Formatting
<pre lang = "msil"> for MSIL Formatting
<pre lang = "midl"> for MIDL Formatting
<pre lang = "php"> for PHP Formatting
<pre lang = "sql"> for SQL Formatting
<pre lang = "vbscript"> for VBScript Formatting
<pre lang = "xml"> for XML Formatting
If you want to enter text like <pre lang = "xml">,

  1. Check the allow HTML radio button in the Tip/Trick editor "When Pasting" option list. Use the article editor to enter text. Copy its HTML and paste here.

  2. Learn the special text for symbols like <(&-lt-; Remove the - for the symbol)

 
Hint: For improved responsiveness ensure Javascript is enabled and choose 'Normal' from the Layout dropdown and hit 'Update'.
You must Sign In to use this message board.
Search 
Per page   
QuestionThis is not working
muhtarqong
11 Feb '13 - 8:28 
GeneralReason for my vote 5
D-Kishore
3 Sep '12 - 19:56 
GeneralReason for my vote of 5 very helpful while we post some tips...
nikhi _singh
15 Feb '12 - 0:03 
Generalwhen & where can i edit a question submitted by someone else...
anushripatil
10 Jan '12 - 18:20 
GeneralReason for my vote of 5 Thx
Pranit Kothari
3 Jan '12 - 15:22 
GeneralReason for my vote of 5 usefull one
RupeshKumar
26 Sep '11 - 5:23 
GeneralReason for my vote of 1 feeeeeeee
aaditya bhargava bansi
17 Jul '11 - 3:00 
GeneralReason for my vote of 5 Really useful!!
Wong Shao Voon
10 Feb '11 - 22:50 
GeneralReason for my vote of 5 Good one
Eswa
11 Dec '10 - 4:05 
GeneralTwo things: this information is already included in the arti...
knockNrod
14 Sep '10 - 6:18 
GeneralOne problem...
Steve Wellens
4 Sep '10 - 13:33 
GeneralRe: One problem...
Steve Wellens
28 Nov '10 - 3:47 
GeneralRe: One problem...
pranav95
29 Nov '10 - 0:26 
SuggestionRe: One problem...
Shahan Ayyub
24 Mar '13 - 5:03 

Last Updated 9 Apr 2013 | Advertise | Privacy | Terms of Use | Copyright © CodeProject, 1999-2013