0

I have selected the complete row of the table, Then I have selected a class that changes the background color of the table row.

Class selection

The background color is not applying to the selected table row, because RTE added header class inside the table data cell.

Excepted

 <tr class="header">
        <td>&nbsp;test</td>
        <td>&nbsp;test</td>
        <td>&nbsp;tesy</td>
 </tr>

Result

    <tr>
        <td>&nbsp;t
        <div class="header">est</div>
        </td>
        <td>
        <div class="header">&nbsp;test</div>
        </td>
        <td>
        <div class="header">&nbsp;tesy</div>
        </td>
    </tr>

Is there any way to achieve the above-expected result in Sitecore RTE?

  • try removing class="header" and check, i think you will need to wrap the whole tr into something else – Sitecore Sam Dec 14 '19 at 19:28
  • i need to add header class to table row, if i use above paragraph classes (refer above image), it is adding classes to tables data cell. Is there any way to add classes to table row in RTE? – Kumar K s Dec 16 '19 at 4:54
  • 1
    instead of <tr class="header"> use th instead and style it. this way you wont have markup issues. – Sitecore Sam Dec 16 '19 at 9:22
  • You could potentially use a snippet if that would make sense. That way you have control over the html that gets spat out. – Jen Dec 19 '19 at 4:04
5

You can add a new CSS class in the Rich Text Editor dropdown and apply it to the selected row table.

There are two steps to add CSS class in RTE:

  1. Add element inWebsite\sitecore\shell\Controls\Rich Text Editor\ToolsFile.xml file.
  2. Now add the definition of that CSS class (eg. arrowlink) in Website\default.css file.

You can see newly added arrowlink CSS class in rich text editor dropdown. And apply this class wherever you want.

| improve this answer | |

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.