Customizing the TinyMCE Table plugin attributes


Hi i am so much struggling with tinymce 2 can you help me understand  some modification on table. Fir starters how to add default CSS class to the table? When I add a table it should have a default CSS class e.g class="table" without any styles attributes. Currently when i add the table it comes with syles style="border-collapse: collapse; width: 100%;" border="1".

So how to remove these attribuets by default? Soeme one sugeested the following, but how can I use it in C# code?

#195039 Jul 11, 2018 17:46

    Probably not the best way, but working for me.... I Can not really remember how I managed to find out this fix, but somehow does the border=1 interfere with the setting of a table class. I have set the border to 0, then the class propery can successfully be set

                    config.Default().AddSetting("visual_table_class", "table");
                    config.Default().AddSetting("table_default_attributes", new { border = 0 });
    #195048 Jul 12, 2018 8:21

    Thank you Sven that was really helpful

    #195055 Jul 12, 2018 10:02