2

I'm trying to integrate CKEditor 4.1.1 in my site. So far, I've mostly got it working, except some of the specific table styles that I have in my site CSS doesn't get applied in the editor. I've already tried setting up config.contentsCss to point to my site-wide stylesheet, and that helps for most of my other contents, but it doesn't seem to apply the table styles. Here's the CSS I'm working with:

table#availability {
    width: 90%;
    border-collapse: collapse;
}

table#availability td, table#availability th {
    border: 1px solid #ccc;
    padding: 4px 7px 5px 8px;
}

table#availability th {
    text-align: center;
    font-weight: bold;
}

table#availability td + td {
    text-align: right;
}

Is this stuff too advanced for CKEditor somehow?

djc
  • 11,603
  • 5
  • 41
  • 54
  • This affects only tables with `id` attribute of **availability**, you sure that once you add a table with CKE, it has the `id` **availability**? – tomsseisums May 27 '13 at 12:16
  • No, but I want tables that already have that ID to be styled as such. – djc May 27 '13 at 13:04

1 Answers1

4

By default CKEditor 4.1 strips out classes, styles, and any attribute that isn't specified in its rules, and of course any element that you can't generate with its buttons. You can check the content generated by the editor to verify that the ACF hasn't destroyed your current content.

If that's the problem, you might want to disable it:

CKEDITOR.config.allowedContent = true;
AlfonsoML
  • 12,634
  • 2
  • 46
  • 53