Opened 17 years ago
Closed 12 years ago
#1858 closed Bug (fixed)
FF:cannot format entire table column - adds code outside <td></td> tags of 1st cell
Reported by: | Tanya | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | General | Version: | FCKeditor 2.5.1 |
Keywords: | HasPatch Firefox | Cc: |
Description
To replicate the bug, create a table with more than one row, enter text into cells then select content of an entire column or row. Select a formatting option such as BOLD or Right Align. Result: firstly, the entire column is not affected secondly, the first cell stuffs up. In the right align example (shown below) the first <td> is altered, placing two empty <p> tags and css styles. In the editor it looks like another cell has been added to the table.
I get a similar issue when trying to format the whole table as "normal" paragraph text.
<table border="1" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<p style="text-align: right;"> </p> <td style="text-align: right;">aaaaa</td> <p style="text-align: right;"> </p> <td>aaa</td>
</tr> <tr>
<td>aa</td> <td>aa</td>
</tr>
</tbody>
</table>
Attachments (3)
Change History (8)
comment:1 Changed 17 years ago by
Keywords: | Confirmed Firefox added |
---|---|
Summary: | cannot format entire table column - adds code outside <td></td> tags of 1st cell → FF:cannot format entire table column - adds code outside <td></td> tags of 1st cell |
Changed 17 years ago by
Attachment: | TC_1858_FF.png added |
---|
Changed 17 years ago by
Attachment: | TC_1858_IE.png added |
---|
Changed 17 years ago by
Attachment: | fckjustifycommands.js.patch added |
---|
I'm not sure that it is good solution but it works :)
comment:3 Changed 16 years ago by
Keywords: | HasPatch added |
---|
It seems that CreateBookmark creates <span>s between <td>s when some cells are selected.
comment:4 Changed 16 years ago by
I don't know if that patch works or not, because I do not know how to apply it. It's still broken in the newest version of FCK though, so this is the solution that fixed it for me:
// Check if there are selected cells, if there are then move the selection // inside the TDs so the following while loop works properly // Don't create a bookmark in firefox as it won't reselect the table cells as // they were before, and firefox doesn't lose the selection in the iframe anyway. var tds = FCKTableHandler.GetSelectedCells(); if (tds && FCKBrowserInfo.IsGecko) { range.SetStart(tds[0], 1); range.SetEnd(tds.last(), 1); } else { // Store a bookmark of the selection since the paragraph iterator might // change the DOM tree and break selections. var bookmark = range.CreateBookmark(); }
And then make sure bookmark exists.
if (bookmark) { range.MoveToBookmark( bookmark ) ; range.Select() ; }
comment:5 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | confirmed → closed |
No longer reproducible in CKEditor.
Confirmed in FF. Works fine with IE.
This bug is a little bit more complicated. Following your example I will write another step by step instruction to reproduce this bug.
1. Create a 3 row table with th sample code below:
2. Highlight the first row and press Right Justify button.
3. The result is:
The expected behavior would be to have a code like this:
So Firefox messes up the table. I've added to screenshots to show the results.
It is possible that we have a ticket opened for this bug. I will look it out.