How to add custom class names to rows when using elgg table listing?

I am using the default table listing view, for a list of entities. In this I want to assign particular class names to the table rows based on particular metadata value on the entity. How is this possible?

I will give an idea of what I am trying to achieve below

$metadata_name = $entity->metadata_name;
$default_options = ["type" => "object",
                    "subtype" => "sex",
                    "view_type" => "person_list",
                    'list_type' => 'table',
                    'limit' => max(25, elgg_get_config('default_limit'), (int) get_input('limit', 0)),
                    'columns' => [
                    'item_class' => $metadata_name,