I modified the location where the pager creates new <td> elements by first asking whether the data contains a td element and if it does, use that instead, this allows the ajax callback to output a fully rendered table with td elements already created, the callback to obtain those elements and just rebuild the columns using those elements, with all the required classnames, attributes, etc.