Many thanks for the feed-back.
Very tough exercice.
Finally I implemented the famous mini-max algorihtm:
Computer looks for value in the following order:
1.- Value where computer wins and make the line.
2.- Value to avoid user winning
3.- Best option for second value: value in line where the first computer value is and there is not any user value.
4. Residual value when none of the above (for example first computer value)
I sorted the resizing if the grid making X and O placed in a new div overlaying the table.
I sorted the highlighting of the line.What highlights is the solution line only and not the array that was accumulating the winner tiles.