Ecommerce Shopify WordPress Discussion

Custom WP_list_table alternating row colors in WooCommerce

Friends, I implemented a class that extends WP_List_Table, and I use the function single_row to override the styles of the rows based on their contents. My code is here: public function single_row( $item ) { $row_class = ($item['status'] == 'submitted') ? '#b2dfbc' : '#ffe9a6'; echo '<tr bgcolor="'.$row_class.'">'; $this->single_row_columns( $item ); echo '</tr>'; } Based on the 'status' field, I'm using either '#b2dfbc' or '#ffe9a6' as a background color. However, the issue arises from WP_List_Table's default utilization of alternating row colors. While my code successfully overwrites the background color for even rows, it does not affect odd rows. Upon inspecting the rendered HTML, I noticed that there is a stylesheet that overrides my background color settings for odd rows. .alternate,.striped>tbody>:nth-child(odd),ul.striped>:nth-child(odd) { background-color: #f6f7f7; } How can I set my preferred background color for odd rows? Adding !important rule doesn't help. Additionally, could you suggest how to control the background color of odd and even rows separately in the single_row function if I want to maintain the alternating coloring? Thanks!
TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.