1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / Apply Style menu add unnecessary <span> tag with the style to the <td> tag in the table cell

Apply Style menu add unnecessary &lt;span&gt; tag with the style to the &lt;td&gt; tag in the table cell

6 posts, 0 answered
  1. Chuck
    Chuck avatar
    5 posts
    Registered:
    05 May 2008
    26 Jan 2012
    Link to this post
    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
  2. Markus
    Markus avatar
    2763 posts
    Registered:
    25 Nov 2005
    26 Jan 2012
    Link to this post
    Dear Chuck

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

    Markus
  3. Jen Peleva
    Jen Peleva avatar
    568 posts
    Registered:
    10 Nov 2016
    30 Jan 2012
    Link to this post
    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
  4. Chuck
    Chuck avatar
    5 posts
    Registered:
    05 May 2008
    31 Jan 2012
    Link to this post
    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


  5. Jen Peleva
    Jen Peleva avatar
    568 posts
    Registered:
    10 Nov 2016
    31 Jan 2012
    Link to this post
    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
  6. Karthik
    Karthik avatar
    1 posts
    Registered:
    04 Jun 2012
    04 Jun 2012
    Link to this post
    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
6 posts, 0 answered