[JENKINS-23330] Spaces in project names are not encoded on <tr> IDs

Hello

I was curious to see if I could contribute to the jenkins project, so I started with a bug classified as 'trivial'. Here's my proposition to solve it. I wrote two functions (with unit tests :-) ) but used only one, because I'm unsure if the problem should be addressed for HTML4 or for HTML5.
Looking forward to your feedback!
Regards,

Dominique