Learner
Learner

Reputation: 121

How to apply css to html code when we are using in ckeditor

I have added background color to th in the below table it is working fine normally. But, if we use same code in ckeditor the style is not applying

<table>
  <thead>
    <tr>
      <th colspan="5" style="text-align:center;
	              background: green;color:#fff;">SPECIAL CLASSES TIME TABLE
      </th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>Firstname</th>
      <th>Lastname</th>
      <th>Email</th>
    </tr>
    <tr>
      <td>John</td>
      <td>Doe</td>
      <td>[email protected]</td>
    </tr>
    <tr>
      <td>Mary</td>
      <td>Moe</td>
      <td>[email protected]</td>
    </tr>
    <tr>
      <td>July</td>
      <td>Dooley</td>
      <td>[email protected]</td>
    </tr>
  </tbody>
</table>

Upvotes: 0

Views: 34

Answers (1)

Anurag Dadheech
Anurag Dadheech

Reputation: 629

Create css class of your applied style and setting the contentCss of ckedior as below

CKEDITOR.config.contentsCss = '/mycustom.css';

Upvotes: 1

Related Questions