This is a more advanced technique but it could be done by checking to see if there are any values for a particular column and if so setting a variable to true. Then down in your code you could put some if statements around the column headers and columns themselves to show or hide these columns depending on weather or not the variable is set to true.
Here is an example of some code that does something like this, in this example I'm using my cart with the name of $eCart and the column I'm testing with is description. I put this code just above the doctype declaration for the html portion of the page.
<?php
$has_description = false;
foreach($eCart1->Items as $key => $value){
if($eCart1->Items[$key]->Description != ""){
$has_description = true;
}
}
?>
So it starts by setting the variable to false, then it loops over every item in the cart and checks to see if there is a description that is not "" for each item. If any item has a description it will set the $has_description to true.
Later down in the code for the cart display you would put in an if statement around the column header and value like this:
header
<?php if($has_description){ ?><th class="eC_GroupColumn" >Description</th><?php } ?>
value
<?php if($has_description){ ?><td class="eC_ItemDescription">Description: <?php echo $eCart1->DisplayInfo("Description"); ?></td><?php } ?>
You would need to account for all of the columns you are trying to conditionally hide in the foreach loop, then make sure to add in the if statements around the column headers and values for each of them.