To implement this, several changes have to be made.
The first one:
class should be added to
cellAttributes to get the value from
cssClass column in the data
The second piece.
The data should be updated to include standard classes 'slds-hide' to hide menu or 'slds-show' to show menu
dataRow.cssClass = this.isOrphaned(dataRow) ? 'slds-hide' : 'slds-show';
Finally, the third piece.
The table may look weird because of no lines between rows where actions are hidden, to mitigate this, a fake additional column is added after the missing one to display the lines under rows which lack the menu items
fixedWidth: 1, hideDefaultActions: true