I had a very hard time to format the code in my blog. At first, I just copy /paste the code from SQL Server management studio to my Microsoft Word application and then post the blog. I thought it was perfect. I really appreciated the work that the SQL Team and Office programmers have done. However, My blog just looked horrible due to the truncation of the html code from Blogger. After using SyntaxHighlighter, my life becomes much simpler. See my post. You can simply use <pre></pre> within your html code with attribute class="brush:text" or class ="brush:sql" for code formatting (there are also some other options). The cooler thing is, in most of time, you don't want to show all the text in your blog as a loooong list and spam your reader's eyes and mind. Here is the solution! You could wrap the text by using <div> tag with overflow:auto; attribute. An example from my post, I was using <div style="width: 100%; height: 220px; overflow:auto; position:relative;"> <pre class="brush:text">loooooong text….</pre></div>. I hope nobody has the issues that I have. If you do, please try SyntaxHighlighter out, it really helps.
Friday, June 26, 2009
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment