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

Tables not aligning correctly or at all

3 Answers 29 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Joe Querin
Top achievements
Rank 1
Joe Querin asked on 25 Nov 2008, 07:52 PM

I have deployed the Rad Editor version 5.3.0 for MOSS into my MOSS enviroment.  We have noticed that when trying to set tables to align to the right or center nothing happens.  I looked at the html that is generated for the table and it is setting the style property to "text-align: right" which only affects the table contents, not the table itself.  The table needs to be wrapped in a div tag with the "text-align: right".

We commonly use tables that are right justified to place announcements or other sidebar content in.  Previous versions of the RadEditor deployed in MCMS has worked fine.  I currently have in production for MCMS Q1 2007 and we do not have any issues.

Is there a way to get this fixed in the editor so we can continue to use our right aligned sidebar tables in MOSS?

 

--

Joe Q.

3 Answers, 1 is accepted

Sort by
0
Stanimir
Telerik team
answered on 28 Nov 2008, 01:26 PM
Hello Joe Querin,

We are aware of this problem. It will be fixed in the next service pack of the ASP.NET AJAX UI Controls.
For now I can suggest you the following workaround.

1. Set the OnClientLoad property of the RadEditor to "OnClientLoad".
2. Add the following javascript in the page.

    function OnClientLoad(editor, args) 
    { 
        editor.get_filtersManager().add(new TableAlignFixFilter()); 
    } 
    TableAlignFixFilter = function() 
    { 
        TableAlignFixFilter.initializeBase(this); 
        this.set_isDom(true); 
        this.set_enabled(true); 
        this.set_name("RadEditor TableAlignFixFilter filter"); 
        this.set_description("Fix table align"); 
    } 
    TableAlignFixFilter.prototype = 
    { 
        getHtmlContent : function(content) 
        { 
            var newContent = content; 
            var tables = newContent.getElementsByTagName("table"); 
            var length = tables.length; 
            for (i = 0; i < length; i++) 
            { 
                var tbl = tables[i] 
                var align = tbl.style.textAlign; 
                if(align) 
                { 
                    tbl.style.textAlign = ""
                    tbl.setAttribute("align", align); 
                }  
                      
            }  
 
            return newContent; 
        }, 
         
        getDesignContent : function(content) 
        { 
            return content;             
        } 
    } 
    TableAlignFixFilter.registerClass('TableAlignFixFilter', Telerik.Web.UI.Editor.Filter); 

All the best,
Stanimir
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Joe Querin
Top achievements
Rank 1
answered on 01 Dec 2008, 02:25 PM
Thank you for the workaround.

Normally this would be simple to implement, but I have the editor deployed in SharePoint as a webpart, thus I do not know how to change the property of the editor since it's not an element hardcoded into my masterpage.

Is there another way to solve the issue without having to change the property of the editor?

--
Joe Querin
0
Stanimir
Telerik team
answered on 04 Dec 2008, 12:43 PM
Hello Joe Querin,

We apologize, but there is no way to turn off this behavior without setting a RadEditor property.
In our online help you can find an article how to Set Properties Via Config File http://www.telerik.com/help/aspnet-ajax/set-properties-via-config-file.html.

If it does not help, we can always send you a custom build.

All the best,
Stanimir
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Editor
Asked by
Joe Querin
Top achievements
Rank 1
Answers by
Stanimir
Telerik team
Joe Querin
Top achievements
Rank 1
Share this question
or