JsDiff & Highlighting Differences Between Table Cells


I’m using the JsDiff library and trying to compare each cell in a row to it’s corresponding cell in the next row; then highlight the differences in the 2nd cell from the first cell. This is how far I’ve come…

The problem is I need it to highlight where the difference is; not just the entire cells contents. Also, when I set it up in jsFiddle it’s not working as it does on my end. I think it’s a different version of JsDiff but not sure.

Here is my jsFiddle: https://jsfiddle.net/7fhunqde/6/

I accomplished what I needed using a different library: https://github.com/google/diff-match-patch

For those in the future that need to do something like this; this library works great. The other does too; it was just a little harder to use.

Sponsor our Newsletter | Privacy Policy | Terms of Service