Disable resizing tables in mozilla in design mode [duplicate]
Is there a way to remove the attribute '_moz_resizing="true"' added by Firefox from <TABLE> to avoid giving user the possibility to resize table in design mode (when contentEditable=true).
Yes.
document.designMode = "on";
document.execCommand("enableObjectResizing", false, "false");
document.execCommand("enableInlineTableEditing", false, "false");
In Firefox, the resizing controls on a table often appear at the same time as the inline table editing controls, so you probably really want to turn off both of them.
If your editable content is inside an iframe, be aware that changes to the CSS position of the ancestor iframe will reset the effects of these commands.
I have prepared a simplified test page that shows this solution in action.
Working in Firefox4, it seems that the answer (at least for now) is 'no'. The command referenced in Chris's answer doesn't appear to work in Firefox4, and removing the attribute or setting it to false does not remove the resize functionality from the object once it has already been selected.
精彩评论