Create a Component say table with dialog field style and rte(only with table and formatting, link plugins).
Create a wrapper div with style class
Example
<div class="${properties.style ? properties.style : 'cmp-table__defualt'}">
${properties.tabletext @CONTEXT='html'}
</div>
If you want to make it generic, then you can use custom style plugin, e.g. https://aemlab.blogspot.com/2019/07/aem-rte-custom-plugins-1.html
Arun Patidar