-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support block content inside tables #3199
Comments
Does it work with collaboration? |
@pjasiun kinda works (I didn't check for editing in the same time of a table though): |
:D BTW, I'm ok with disallowing tables in tables. I even think that it should be the default. Block content makes sense in table cells, but whole tables do not. Let's start with such a simplification and see. |
Me too. But it is cool that it is possible :) |
OK time for some decisions to make as I've almost got this working: @Reinmar / @pjasiun / @oleq : Things to consider:
ps.: Right now I have this thing working with some minor bugs with tab/shift+tab but this probably will be resolved quickly. Edit: Added point 5 about tab in list in table cell. |
After some F2F talks:
|
@Reinmar & @pjasiun another thing... What if <table>
<tableRow>
<tableCell>
<paragraph textAlign="left">foo</pargraph>
</tableCell>
</tableRow>
</table> so the output will be: <table>
<tbody>
<tr>
<td>
<p style="text-align:right;">foo</p>
</td>
</tr>
</tbody>
</table> |
Yes... and no. I forgot about this but we discussed it on the first meeting. The problem here is that when you have a single block of content in a table cell then clicking the alignment buttons may also apply to the entire table cell... In fact, such option might also be useful even if there are multiple blocks. Unfortunately, as most non-semantical information, it can be applied pretty much everywhere and I can easily imagine people wanting to do all these things. Let's extract this to a separate ticket because it may be a long and tiring discussion. |
@oleq: maybe something to consider is how to style block contents inside table. With current styles we have something like this: The most annoying are centered lists but other styles might some tuning also. |
I guess we should fix the styles. OTOH:
|
I think that a table with one table cell with block contend and single paragraphs (inline content?) will already mix:
A perfect solution would be conditionally loaded styles for integration purposes like |
This is quite frequent use case. See for example:
|
@oleq As ckeditor/ckeditor5-table#97 is almost ready: how to change table's content styles: should we revert to left alignment for table cells? Mixed? Follow up? |
Ping, @oleq |
TBH I'm not sure I understand this question. But I'd go with either:
I guess there's no good reason for CKE5 to stand out so I'd rather go with the later. It's simpler too and doesn't need maintanence as new content types arrive down the road. TBH, I don't quite remember why we went with centered table content in the first place (anyone?). |
👍 |
We may perhaps consider whether headings should be centred or not. They will rarely contain block content and I think that it's frequent to centre them, but I don't know if it's worth potential problems and introducing such a difference in comparison to normal cells. |
@Reinmar & @oleq to sum up and finish ckeditor/ckeditor5-table#97: The styles of block contents inside a table will be as they are in other parts of the editor:
|
Feature: Support block content inside table. Closes #56. BREAKING CHANGE: Removed `table/commands/utils~getParentTable()` method. Use `table/commands/utils~findAncestor()` instead.
The MVP of the table feature doesn't contain a support for block content inside table cells. So, the first version will only support inline content (no images, no lists, no hard line breaks etc.)
Support for block content is our next priority after releasing the MVP. The challenge here is the UX. By default, we insert a table with inline content only:
When the user presses Enter in one of the cells, what should happen? We need to insert paragraphs there:
Is it ok that only one cell has block content and the other has inline content? This may cause vertical misalignment due to styling (paragraphs have margins) and general mess. So perhaps once you create block content in one of the cells, we should turn the entire table into "block table"?
There are also implementation issues. How to reflect that in the schema? A cell may contain inline content. Or it may contain block content. These are two different types of cells. Two different elements. Also, for features like headings, lists, etc. to be enabled, a block must be allowed in the current selection position. So, without paragraphs in the model all these features will be disabled. So, in fact, we always need paragraphs in the model.
And so on and so on :)
The text was updated successfully, but these errors were encountered: