1

I use CKEditor (WISYWYG editor) to edit text and HTML for my Drupal project. I want to edit an HTML table and try to horizontally align text in a table cell <td> to the right.

My steps:

  1. select the text in the table cell
  2. right+click > Cell > Cell properties > Horizontal Alignment: Right.

When I am logged-in and I inspect the HTML I see <td style="text-align: right;">My text</td>. But as soon as I am logged-out the HTML is stripped and I see only <td>My text</td> (style="text-align: right;" disappeared).

I certainly need to align my text to the right in some HTML table cells.

Update:

  1. I use Filtered HTML
  2. In admin/config/content/formats/filtered_html, I added the following settings (see screenshot):

enter image description here

2
  • Please, can you mention (1) what text format are you using while you are doing this and (2) what is the filter process setting for that text format. 1st one you can find at juts by observing whetehr it is plain text, Filtered text or Full HTML. 2nd one you can find at by going at Admin/Configuration/Content Authoring/Text Format. Please add the screen shot for 2nd one if you can, with Limit allowed HTML tags which is on same page. I think by this time you would have understood what is the issue and where to look..:)
    – CodeNext
    Commented Oct 17, 2016 at 10:53
  • till this time I was trying to figure out, I searched all tutorials and tried every code but with Filtered HTML text format, CKeditor strippes off the inline style attributes no matter what, If I will come to know I will let you know, If you come to know please you let me know...:(
    – CodeNext
    Commented Oct 17, 2016 at 17:04

1 Answer 1

0

Had a similar issue for a long text field (filtered html format).

HTML tags were getting removed when switching between formats (editor was removing them).

At /admin/config/content/ckeditor/edit/Advanced (advanced is a profile name used for the filtered html format in my case), under "advanced content filter", choosing disabled solved the issue (server side filtering works, this filtering is there for the wysiwyg ux essentially).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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