.replace(/^\s+|\s+$/gm,'');

trim out whitecaps if table from html is filled with a href or data-attrib's