Try our conversational search powered by Generative AI!

[EPi 10] - Custom class - Insert / Edit table

Vote:
 

I was wondering if anyone knows how to add a custom class in the drop down menu in Insert/Edit table.
I know i could go to the file and add it (How to for EPi6)
But since we are upgrading EPi every month this is not a solution (cannot be doing everytime we upgrade).


The pop up. Insert/Edit table

#173213
Dec 16, 2016 8:28
Vote:
 

can also add that i have been playing around a bit with doing it from code

[TinyMCEPluginNonVisual(
PlugInName = "DefaultSettings",
AlwaysEnabled = true,
ServerSideOnly = true,
EditorInitConfigurationOptions = @"{

and the global editor.css (that you point out from Admin)

table {
EditMenuTitle: Styles;
EditMenuName: Skanska table;
border:0; margin: 0 0 0 0;
border-spacing: 0;
border-collapse: collapse;
line-height:14px;

}

#173214
Dec 16, 2016 8:35
Vote:
 

Maybe EPiServer have to change some things in the table.htm in order for us developers to be able to add custom classes from code?
http://stackoverflow.com/questions/11203896/own-default-table-style-in-tinymce

#173215
Dec 16, 2016 8:43
Vote:
 

If I understand your question correctly then you're pretty much there. To add classes to the table classes dropdown, add your classes to the editor.css, remembering to prefix them with 'table' for example:

table.grey-table {
    EditMenuTitle: Tables;
    EditMenuName: Grey Table;
    background: #ccc;
    border: 1px solid #999;
}

table.blue-table {
    EditMenuName: Blue Table;
    background: #ccf;
    border: 1px solid #00f;
}
#173245
Dec 16, 2016 16:33
Vote:
 

Thanks Paul.

All i missed was to give it a name i.e. table.name

#173274
Dec 19, 2016 11:01
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.