It renders properly if you force the outermost table to be 'display: inline-table'. For example, by adding a rule like
Code:
#wrap > table {
display: inline-table;
}
to your CSS. (I would recommend instead giving your chess-problem tables a semantic @class attribute and hanging the CSS rule off of that, as well as ditching the nested tables and using CSS for everything except the board layouts, but YMMV.)