none
Code Blocks (PRE tags) aren't formatting in fixed-width fonts RRS feed

  • Question

  • When inserting a code block, the resulting font is not adhering to the <PRE> HTML spec in that the font is still a proportional font:

    SELECT A.Product,
           A.Type,
           A.Indication,
           A.Strength,
           A.Year,
           A.Quarter,
           A.Month, 
           A.Sales_Volume,
           COALESCE(B.Sales_Volume,0) as TRX_VOLUME_LAST_MONTH
           
      FROM myTable as A
      
      LEFT JOIN myTable as B
        ON A.Product = B.Product
       AND A.Type = B.Type
       AND A.Indication = B.Indication
       AND A.Strength = B.Strength
       AND A.Year = B.Year
       AND A.Month = B.Month - 1;


    Phil Brammer | http://www.ssistalk.com
    Wednesday, September 23, 2009 1:40 PM

Answers

All replies

  • The above, by the way, looks correct in the editor BEFORE I post, so something between creating the post and actually posting it is changing the font.  A CSS issue?

    This is what I would expect it to look like (including the border around the code block, and with colored language keywords as appropriate):




    Phil Brammer | http://www.ssistalk.com
    Wednesday, September 23, 2009 1:43 PM
  • Turns out this is a browser issue...  Sigh...

    Here's how it renders in Chrome:




    Phil Brammer | http://www.ssistalk.com
    Wednesday, September 23, 2009 2:41 PM
  • Yes it is a browser/system issue.

    My laptop shows all code blocks as Courier New, but a computer at a client site shows it as Arial.

    Both use IE8 (8.0.6001.18702).

    Both have Tools -> Internet Options -> General -> Fonts set to "Courier New" set for "Plain Text Font". 

    Both have Tools -> Internet Options -> General -> Accessibility with all checkboxes unchecked.

    --Brad

    --Brad (My Blog)
    Wednesday, September 23, 2009 4:56 PM
  • Comes out proportional for me on both IE8 and Firefox.

    I'm pretty sure this is a forum issue.
    Friday, September 25, 2009 9:13 AM