Adding appropriate classes to the cells