I am creating a fairly simple HTML table creator / editor (based on iframe designMode) at work using direct manipulations with the DOM. This pain is obviously due to Internet Explorer.
When in designMode, the table inserted in the iframe editing area changes and can freely edit the contents of the cells. In Firefox, you can also add and remove rows and columns. I am currently focusing on editing border borders, foreground and background colors and other things that require the DOM to work.
The problem is the lack of proper DOM Selection / Range functionality in IE6 / 7. I cannot find the contained nodes for several cells selected at the same time. For a single cell, this is possible with parentElement, but for several selected cells, parentElement is a TR node that houses TD cells. I canβt understand how to extract node references only to TD cells inside this TR that were selected due to the lack of anchorNode, focusNode and various offsets that the W3C DOM provides.
I have already created table creation and style modification for individual cells, as well as a group of selected cells implemented for browsers compatible with W3C, but I completely hung in IE. Can jQuery help me? I have never used it, but it seems intuitive enough that it will take less time to learn than to figure out how to do this using the IE DOM.
There are three main style change scenarios that should work:
- A table cell that was not explicitly selected using the Ctrl / Cmd click, but has a text cursor inside it, must have its own background color. A cell can have rich text or other complicators parentNode / childNode relationships.
- (Ctrl/Cmd-clicked, Shift-selected "" ) . , .
- ( , ..) " ". , , , ( 1), ( 2).
Firefox . - . - ?
( IE , jQuery. : 164147, 218043, 235411)