I don't know about your cell widths (are they variable?), but table elements render as such. For getting the desired effect, they need to be displayed as something else:
tr {display: block;}
td, th {display: inline-block; background: transparent;}
You will notice, that now you need to set widths for td and th elements, though.
See Demo.