Click here to Skip to main content
Click here to Skip to main content

Formatting code in Tips and Tricks

By , 8 Apr 2013
 
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)

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Anshul R
Student
India India
Member
No Biography provided

Comments and Discussions

Comment 14 messages have been posted for this article Visit http://www.codeproject.com/Tips/87155/Formatting-code-in-Tips-and-Tricks to post and view comments on this article, or click here to get a print view with messages.

Permalink | Advertise | Privacy | Mobile
Web04 | 2.6.130513.1 | Last Updated 9 Apr 2013
Article Copyright 2010 by Anshul R
Everything else Copyright © CodeProject, 1999-2013
Terms of Use