How to set border for each side of a table cell with CKEditor?

I have a table in CKEditor4(Upgrade to CKEditor 5 is possible if that is the only solution) that I need to configure the border for each cell differently. For example some cells might have a border-top and border-bottom while others might need to have a border-left and border-top.

I tried using styles, but you can’t add multiple styles to a table or td in ckeditor. I also tried using the table toolbar plugin, but you can’t configure border to individual sides with it. Does anybody know if it is possible either to add multiple styles or whatever else it may be to be able to configure table cell borders down to each side of the cell?