3

I've created a table style ex:

.testTable-default
{
 -ms-name:"Tabell - test";
 border:1px solid $borderColor; // sass syntax
 margin: 8px 0;
 width:98%;
}

I've removed all other table styles and the custom table style shows in the ribbon. But how can I always apply the style to all tables in content editor web part?

What I want is when inserting tables it always uses that specific table branding without having to click in the ribbon on that specific table styling.

5

If you don't apply any particular style to a table inserted in a CEWP, it'll get applied the class ms-rteTable-default.

So, instead of what you have done, you can override -in your custom css file- that class:

.ms-rteTable-default{
   -ms-name:"Tabell - test";
   border:1px solid $borderColor; // sass syntax
   margin: 8px 0;
   width:98%;
}

Just make sure to load your css after the core.css stylesheet

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.