fixed row and column deletion issues with table legend