override theme css with woocommerce css WordPress

SOLVED

In order to avoid conflicts between theme css and woocommerce css, I would love woocommerce css to override theme css (ex: button, tables etc are styled by theme, I want theme to be styled by woocommerce in woocommerce pages).
Should I change priority order? How can I do that?
Please help me.

add_action can use 4 parameters add_action( $hook, $function_to_add, $priority, $accepted_args );
you can add a $priority

/*
from codex https://codex.wordpress.org/Function_Reference/add_action#Parameters
$priority
(int) (optional) Used to specify the order in which the functions associated with a particular action are executed. Lower numbers correspond with earlier execution, and functions with the same priority are executed in the order in which they were added to the action.
*/

My suggestion is change the priority when load the "theme css" to 1, will include theme css before woocommerce (by default 10);

that is not the right way to do that, then I can't update woocommerce with re-do everything. And also there are some ! important in theme as well, so woocommerce ! important would be override by theme.

Create a a child theme and put your woo css in the child themes styles.css file. This will by default load last and whatever styles are loaded last take priority. The exception is when !important is used, however you can add your own !important tags to the css in the child theme and it will again take priority over a style in the parent theme.

There are simpler ways to change order. We don't know how your theme loads styles, but let's assume that is follow approach of Twenty Fifteen, latest default theme that uses 'wp_enqueue_scripts'.

What we need is to push enqueueing later in that order since by default priority is 10. We can do that by simply removing action and then immediately adding with higher priority. This is tested and it works in Twenty Fifteen.

If this doesn't change order, your theme is probably using something else to load styles. Although best thing is to have a look at theme's code, this approach always works, but it is not best because WooCommerce styles are loaded in footer.

Since you are enqueueing styles on hook 'wp_enqueue_scripts' with priority 100, my first code snippet above should work because it does the same, only with priority 999, which means it is later in order.