how to filter into a html table by only the first characters using JavaScript

I am working whit JS and tables done in JSON, my question is how can I filter my table by writting only the first 3 letters of each word ,for example: if my td is:

COMPRA MERCADERIAS - EFECTIVO

I should write: "COMP MERC EFEC"

this the page where I am working http://dinamica-contable.contasic.org/contenido/dinamica/paginas/buscador.html

I hope someone could help me