changed css not applied to new elements??

changed css not applied to new elements??

I want to change css ... for example I am using:
  1. $('table').css('background-color','green')
But then, when I go to add a new table (as below), it is colored the same way as the initial css definition
  1. $('<table><tr><td>a</td></tr></table>').appendTo('body');
I did do a goole search before this, but the "fix" seemed to be more of a work around and involves cloning existing elements (which sounds horrid )

I did up a quick example here:
https://jsfiddle.net/mam80cxj/

Any ideas?
Thanks,
Kris