1 person found this helpful
When posting content that contains code or fixed width text, where you want to preserve the layout you have two options...
Both of these require using the "Advanced Editor" so you should always post/reply from the thread itself, and not from the Inbox; as the Advanced Editor option isn't available through the inbox (yet!)
Firstly post your code/formatted content, in to the editor and highlight it all
option 1) Click on the double chevron ">>" icon on the editor toolbar, a drop down menu appear, select Syntax Highlighting and then pick SQL
option 2) Click on the "Font Family" drop down in the editor toolbar and pick "Courier New" as your font; (optionally) also then click the double chevron ">>" icon and choose "Quote" as this will embed the code in a frame within the post
Note: with option 1, the syntax highlighting will put line numbers in front of each line, and this can be problematic if people want to copy out the code/text for themselves as they end up with all those line numbers that they have to remove before they can use it. Personally, I prefer option 2.
Thank you very much for the response and it's worked nicely. Also in another post publisher mentioned about some tag related to format preserving (eg: \)
Here the link HOW TO: Post a SQL statement tuning request - template posting .
Do you know about these kind of tags where we can include in a post? Because I couldn't find a way to get the expected result from a tag where your method worked as a charm.
That's an old post from 2009.
Back then, the community forums supported various standard formatting tags such as [code] and [/code], but those are no longer used, so when Randolf refers to the "/" tag, he's meaning that the user should ensure they used the [/code] closing tag after the formatted code.
That no longer works, so ignore it.