This is a migrated thread and some comments may be shown as answers.

<style> tag is removed after inserted from Template Manager in RedEditor

4 Answers 46 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Leo
Top achievements
Rank 1
Leo asked on 10 Oct 2008, 10:42 AM
Hello,
When I insert template files from Template Manager, I notice all <Style> tags will be removed. Below steps could repro the problem.







1) open notepad and save the following lines as template.htm
---------------
<BODY>
<STYLE type=text/css>
     table.custom {
         border-width: 1px;
         border-spacing: ;
         border-style: outset;
         border-color: gray;
         border-collapse: separate;
         background-color: white;
            }
       table.custom th {
         font: bold 11px  Arial;
         color: #4f6b72;
         border-right: 1px solid #C1DAD7;
         border-bottom: 1px solid #C1DAD7;
         border-top: 1px solid #C1DAD7;
         letter-spacing: 2px;
         text-transform: uppercase;
         text-align: left;
         padding: 6px 6px 6px 12px;
         background: #CAE8EA url('images/bg_header.jpg') no-repeat;
        }
</STYLE>
<TABLE class=custom width="100%">
<TBODY>
<TR>
<TH>&nbsp;Category&nbsp;</TH>
<TH>&nbsp;Comments&nbsp;</TH></TR>
<TR>
<TH class=spec>All:&nbsp;</TH>
<TD class=td style="WIDTH: 90%"></TD></TR>
<TR></TR></TBODY></TABLE></BODY>
------------------------



2) In RadEditor, insert this template.htm from Template Manager. What you get is
---------------

<BODY><TABLE class=custom width="100%">
<TBODY>
<TR>
<TH>&nbsp;Category&nbsp;</TH>
<TH>&nbsp;Comments&nbsp;</TH></TR>
<TR>
<TH class=spec>All:&nbsp;</TH>
<TD class=td style="WIDTH: 90%"></TD></TR>
<TR></TR></TBODY></TABLE></BODY>




----------------

Why Template Manager would like to remove my <style> tag? any workaround? thanks.

4 Answers, 1 is accepted

Sort by
0
Accepted
Rumen
Telerik team
answered on 10 Oct 2008, 03:18 PM
Hi Leo,

This is a browser behavior. To workaround it, you should put some content before the <style> tags, for example simple &nbsp; entity. If this does not help, remove the <BODY> tag too, because it is always stripped by the browser.

Directly try to insert the following content:

&nbsp;
<STYLE type=text/css>
     table.custom {
         border-width: 1px;
         border-spacing: ;
         border-style: outset;
         border-color: gray;
         border-collapse: separate;
         background-color: white;
            }
       table.custom th {
         font: bold 11px  Arial;
         color: #4f6b72;
         border-right: 1px solid #C1DAD7;
         border-bottom: 1px solid #C1DAD7;
         border-top: 1px solid #C1DAD7;
         letter-spacing: 2px;
         text-transform: uppercase;
         text-align: left;
         padding: 6px 6px 6px 12px;
         background: #CAE8EA url('images/bg_header.jpg') no-repeat;
        }
</STYLE>
<TABLE class=custom width="100%">
<TBODY>
<TR>
<TH>&nbsp;Category&nbsp;</TH>
<TH>&nbsp;Comments&nbsp;</TH></TR>
<TR>
<TH class=spec>All:&nbsp;</TH>
<TD class=td style="WIDTH: 90%"></TD></TR>
<TR></TR></TBODY></TABLE></BODY>


Best wishes,
Rumen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Leo
Top achievements
Rank 1
answered on 13 Oct 2008, 03:52 AM
Great. It works. thank you.
0
Andrés Salinas
Top achievements
Rank 1
answered on 21 Apr 2010, 08:13 PM
Hi,

The solution posted works fine in internet explorer and chrome, but in firefox doesn't.

Any ideas?

Regards,
0
Rumen
Telerik team
answered on 23 Apr 2010, 12:33 PM
Hello Andrés,

Just put the style tags after the HTML content and this will solve this FF issue, e.g.

<TABLE class=custom width="100%">
<TBODY>
<TR>
<TH> Category </TH>
<TH> Comments </TH></TR>
<TR>
<TH class=spec>All: </TH>
<TD class=td style="WIDTH: 90%"></TD></TR>
<TR></TR></TBODY></TABLE>
 
<STYLE type=text/css>
 
     table.custom {
         border-width: 1px;
         border-spacing: ;
         border-style: outset;
         border-color: gray;
         border-collapse: separate;
         background-color: white;
            }
       table.custom th {
         font: bold 11px  Arial;
         color: #4f6b72;
         border-right: 1px solid #C1DAD7;
         border-bottom: 1px solid #C1DAD7;
         border-top: 1px solid #C1DAD7;
         letter-spacing: 2px;
         text-transform: uppercase;
         text-align: left;
         padding: 6px 6px 6px 12px;
         background: #CAE8EA url('images/bg_header.jpg') no-repeat;
        }
</STYLE>



Best wishes,
Rumen
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Editor
Asked by
Leo
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Leo
Top achievements
Rank 1
Andrés Salinas
Top achievements
Rank 1
Share this question
or