Opened 7 years ago

Last modified 7 years ago

#9154 confirmed Bug

cell properties are applied to all children

Reported by: Mihai Secasiu Owned by:
Priority: Normal Milestone:
Component: Core : Tables Version: 3.0.1
Keywords: Cc:

Description

When selecting a cell with the elementspath tool and then applying cell properties, if the selected cell contains a table, the cell properties are also applied to the cells of the child table.

This is bad because it makes it impossible to apply some properties only to the cell I want. For example: I could have a cell with a red background ( the parent cell ) which would contain a table with cells of different backgrounds. If I want to change any property on the parent cell then all of the properties of this cell would be applied to all cells in the child table.

I tested this with the latest version of ckeditor from the demo page. Out of curiosity I also tested other online editors ( xinha and tinymce ) and they don't behave like this ( please don't tell me to use those, I think ckeditor is the best :) )

Change History (3)

comment:2 Changed 7 years ago by Mihai Secasiu

Ok, I figured this is the intended behavior in ckeditor but I think the way the other editors handle this is better or at least the user should have the choice to apply to entire selection or just the outer cell.

The problem is in real html pages there's often no way or very very hard to select the outer cell because the child table occupies the entire cell.

Take this code for example

<table>
<tr>
<td style="background-color: red">
<table width="100%">
<tr>
<td style="background-color: green">a</td>
<td>b</td>
<td>c</td>
<td>d</td>
<td>e</td>
<td>f</td>
<td>g</td>
<td>h</td>
</tr>
</table>
</td>
</tr>
</table>

Now let's say I want to change the background color to blue for all sub cells except the one that contains "a", all I'd have to do is change the background color of the upper td, the green one. But I can't select that alone so if I use the elements path I select all element it contains and the style will be applied to all including the one that is now green and I don't want to change. I know I can fix this but what If I had a lot more green cells like that. It would be a lot of work to change it back and also this feature should make it easier for non technical users to apply the background color. I can always modify html but the users I'm targeting don't know html.

Maybe a better solution is to have the elements path select only the outer cell not everything inside.

If not then how can I select the outer cell ( the red one in the example ) without selecting it's children in the process?

comment:4 Changed 7 years ago by Mihai Secasiu

What I'm saying is that you cannot click in the outer cell, also I can't move it there. Am I missing something? I just tried the exact code in http://ckeditor.com/demo and it seems like there's no way to click or move the cursor to the cell with the red background.

comment:5 Changed 7 years ago by Jakub Ś

Status: newconfirmed
Version: 3.6.33.0.1

@mihai you are right – selecting cell in elements path and applying properties should result in modifying only this cell and not everything in this cell. It works that way in lists.

Current behaviour is confusing and in browsers, like IE, it is not possible to perform a pure cell selection, which would make it impossible to set the properties of the single outer cell only.

To summarize:

In both lists and tables Properties should be applied to top most level of the selection only


There is also another problem that has first occurred in CKEditor 3.6.1. When you apply properties to internal cells it is also transferred to external cell which is not correct. Reported here: #9174

Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy