Apply Style menu add unnecessary <span> tag with the s

Posted by Community Admin on 04-Aug-2018 17:01

Apply Style menu add unnecessary <span> tag with the style to the <td> tag in the table cell

All Replies

Posted by Community Admin on 26-Jan-2012 00:00

Hello,

I have been trying different ways to get the apply style menu to work but fails. Here is my scenario.
1) I added a entry in the toolbar.xml with the following entry:
  <cssFiles>    
     <item name="~/styles/utd-TableEditorStyle.css" />    
  </cssFiles>
2) The utd-TableEditorStyle.css contains many pre-defined styles, including
td.subtitle1
 vertical-align: middle;
 text-align: center;
 font-size: 1.2em;
 font-weight: bolder;
 padding-top: .8em;
 padding-bottom: .3em;
 border-bottom: #000 3px solid;
 background: #EEE;
 
3) In the RadEditor table, the table cells contains data like
                <tr>
                    <td>Hev b 1*</td>
                    <td>Rubber elongation factor</td>
                    <td>58/14.6</td>
                    <td>-</td>
                    <td>Papain, fig</td>
                </tr>
4) After run 'Apply Style' menu with 'td.subtitle1' entry to a selected whole or partial table row, the command add extra <span> with the style 'td.subtitle1 ' instead of apply the style to the <td> tag. The HTML source becomes:
                <tr>
                    <td><span class="subtitle1">Hev b 1*</span></td>
                    <td><span class="subtitle1">Rubber elongation factor</span></td>
                    <td><span class="subtitle1">58/14.6</span></td>
                    <td><span class="subtitle1">-</span></td>
                    <td><span class="subtitle1">Papain, fig</span></td>
                </tr>

I'm expecting the HTML source should look like:
                <tr>
                    <td span class="subtitle1">Hev b 1*</td>
                    <td span class="subtitle1">Rubber elongation factor</td>
                    <td span class="subtitle1">58/14.6</td>
                    <td span class="subtitle1">-</td>
                    <td span class="subtitle1">Papain, fig</td>
                </tr>
Is this a bug? Do we have a workaround solution?

Thanks
Chuck Wan

Posted by Community Admin on 26-Jan-2012 00:00

Dear Chuck

Sorry I missread your post and had to delete my answer.

Markus

Posted by Community Admin on 30-Jan-2012 00:00

Hello Chuck,

To set css class to a cell select the cell, right-click on it and choose Cell Properties. In the right side of the dialog that opens, you will see the AppyCss dropdown and will be able to choose a css class from it.

Regards,
Jen Peleva
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 31-Jan-2012 00:00

Hi Jen,

Thank you for your response. 
I have no problem using either the 'Cell Properties' dialog or the 'Apply Style' toolbar menu to change the style of an individual tabel cell. The problem happens when I select the entire row or multiple cells from a row, then the apply style does not works. It adds an extra <span> tag to the cell (see my initial input).

Is there any workaround solution for not creating extra <span> when I apply style to more than one selected columns for a table row?

Thanks,
Chuck


Posted by Community Admin on 31-Jan-2012 00:00

Hi Chuck,

Unfortunately, there is no workaround for this case, since the css class is set to certain selected area. When you seemingly select multiple cells you actually select the content of the cell, thus when the cell is empty, the AppyCss drop-down inserts additional span tag. The only possible approach is to set class per cell, as I explained in my previous post.

Regards,
Jen Peleva
the Telerik team

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 04-Jun-2012 00:00

Hello Friend,
     You can't do this.Becoz the td is one tag and span is another tag.You can't merge them.
      You should use the following format:
     <td><span></span></td>

regards
Karthik
www.aroundtheworldofmine.co.in

This thread is closed