6

Is there anyway to not display the row and column modification (the 2 arrows and cross) when making a table editable. I went through the W3C draft for contenteditable and it doesn't talk anything about the specific cases of different elements.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Diff.Thinkr
  • 855
  • 1
  • 8
  • 16

1 Answers1

10

If I understand you correctly, the following will do it in Firefox (note: apparently the document must be loaded before this command can be executed. See comments below):

 document.execCommand("enableInlineTableEditing", null, false);

See also this question: Javascript, Firefox: how to disable the browser specific cell controls?

Community
  • 1
  • 1
Tim Down
  • 318,141
  • 75
  • 454
  • 536
  • 2
    In newer versions of Firefox this throws `Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMHTMLDocument.execCommand]` – Matt Zukowski Mar 23 '12 at 19:29
  • Looks like you have to wait until the document is fully loaded before calling document.execCommand. – Matt Zukowski Mar 23 '12 at 19:55
  • @MattZukowski: Quite possibly, but did that really warrant a downvote? The approach is correct. – Tim Down Mar 23 '12 at 22:25
  • I didn't find out what the issue was until much later. Not able to un-downvote at this point. I generally downvote answers that I don't find helpful in order to solicit better solutions. – Matt Zukowski Mar 28 '12 at 23:50
  • @MattZukowski: I've edited my answer to include a note about the document needing to be loaded. – Tim Down Apr 02 '12 at 11:27
  • 3
    @MattZukowski Document have to be fully loaded AND since FF15 also need to have some contenteditable enabled element. –  Oct 26 '12 at 23:14