This is a method for showing line numbers in online code listings without using JavaScript. Since this is so simple, I will only say that viewing the page source of this post will show the method quite clearly.

This is an example of my line numbering scheme.

The numbers are not text, they are an image and
never get copied when the code text is copied.

I did this using two tags, the pre tag and the code tag. I could have manipulated the background image to have the numbers and the horizontal stripes but it would be a big image and isn’t necessary for this blog where I can add both tags to code listings.