Fix #13232, fix jQuery.buildFragment for tables, close gh-1138.