Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 4 down vote accepted

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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