How do you show code on a website? Right now I define a bunch of CSS styles called Comment, Preprocessor, Keyword, etcetera. Then make a two column table, make the left column line numbers and and the right column each row has a line of code. Then I manually go through the code assigning CSS styles where appropriate. The problem is that this is tedious, especially for long pieces of code and it is not portable so if I need to change things it takes a long time. I am very new to website programming and have no idea where to start with this. Any help?
Labdabeta
182
Posting Pro in Training
Featured Poster
Recommended Answers
Jump to PostCan I ask why you want to show code on a website?
Jump to PostUnfortunately I don't think I can help but I think you mean to display code like you would on this forum, in code tags, and I don't know how to do that (mainly because I have needed to do it so haven't looked into how it is done).
With …
All 5 Replies
simplypixie
123
Posting Pro in Training
Labdabeta
182
Posting Pro in Training
Featured Poster
simplypixie
123
Posting Pro in Training
Labdabeta
182
Posting Pro in Training
Featured Poster
pritaeas
2,194
¯\_(ツ)_/¯
Moderator
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.