Page 1 of 1

TinyMCE give table a css-class

Posted: Mon Nov 30, 2020 4:54 pm
by janvl
Hi,

i am looking for a way to pass a default css-class for tables made in TinyMCE.

I have been looking in the module-settings, the javascript-files and in the website of tinymce.
I have cmsms 2.2.15 with tinymce-module 3.3.2

regards,
Jan

Re: TinyMCE give table a css-class

Posted: Mon Nov 30, 2020 5:14 pm
by velden
can't you use a class/id for the container of the user-added content?

Example:

Code: Select all

<div id="user-content">{content}</div>
Styling:

Code: Select all

#user-content table { 
  ...css...
 }
jQuery selector:

Code: Select all

jQuery("#user-content table")....

Re: TinyMCE give table a css-class

Posted: Mon Nov 30, 2020 9:57 pm
by janvl
Hi Velden,

Thanks.

i might solve the problem this way, using an extra container div for the table.

I use W3.CSS that brings its own classes.

The user is not able to manipulate the HTML. Maybe your idea combined with a snippet will works.
I will try that.

Regards,
Jan