Pandas' to_html simply provides the output of a large string containing HTML table markup. The class argument is a convenience handler to give the <table> a class characteristic that will be referenced in a previously created CSS document that styles it. Hence, incorporate to_html into a wider HTML document build that references an external CSS.
Interestingly, to_html adds dual classes <table class="dataframe mystyle"> which can be referenced in CSS individually, .dataframe {...} .mystyle{...}, or together .dataframe.mystyle {...}.