Skip to content
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

Missing line-shift when tables are aligned to the left #9982

Open
jensen-lin opened this issue Jun 29, 2021 · 2 comments
Open

Missing line-shift when tables are aligned to the left #9982

jensen-lin opened this issue Jun 29, 2021 · 2 comments
Labels
support:2 An issue reported by a commercially licensed client. type:feature This issue reports a feature request (an idea for a new functionality or a missing option).

Comments

@jensen-lin
Copy link

jensen-lin commented Jun 29, 2021

Add a table
align table to left
Add a new table
align table to left
Expected: Tables are below each other same way as if the tables where aligned to center
Actual: Tables are aligned close up

EDIT: We have introduced non-float alignment for images - https://ckeditor.com/docs/ckeditor5/latest/features/images/images-styles.html#presentational-styles - we could introduce same type of extra alignment for tables.

@jensen-lin jensen-lin added the type:bug This issue reports a buggy (incorrect) behavior. label Jun 29, 2021
@FilipTokarski FilipTokarski added type:feature This issue reports a feature request (an idea for a new functionality or a missing option). and removed type:bug This issue reports a buggy (incorrect) behavior. labels Jul 5, 2021
@FilipTokarski
Copy link
Member

Hi thanks for the report. I'll add some visuals here, so anyone reading this ticket doesn't need to reproduce this themselves.

Current state ( I'm using editor.execute( 'tableAlignment', { value: 'left' } ); ) :

0_table2.mp4

Expected state:
table1

I'll convert this into a feature request, so please add 👍 to bumps its popularity.

@jswiderski
Copy link

jswiderski commented Jul 12, 2021

We have introduced non-float alignment for images - https://ckeditor.com/docs/ckeditor5/latest/features/images/images-styles.html#presentational-styles - we could introduce same type of extra alignment for tables.

For those who can’t wait until this feature is ready simple plugin which overwrites default behaviour and instead of float styles, it uses margins just like the image plugin does: tableAlign.zip

In order to use this plugin you need to build CKEditor from source: https://ckeditor5.github.io/docs/nightly/ckeditor5/latest/builds/guides/integration/advanced-setup.html#scenario-2-building-from-source

In order to use the plugin in your code you need to set it up as follows:

import TableAlign from './_your_plugins_folder/tableAlign/tableAlign.js';

ClassicEditor.create( document.querySelector( '#editor' ), {
        plugins: [ ...,TableAlign, ...		],
...

obraz

NOTE: If you are using default alignment for tables, you will have to use matching styles as well e.g.
Table feature configuration

table: {
    tableProperties: {
	// The default styles for tables in the editor.
	// They should be synchronized with the content styles.
		defaultProperties: {
			alignment: 'left'
		}	
	}
}

Matching CSS styles for HTML page where editor is used

.ck-content .table {
	margin-left: 0 !important;
	margin-right: auto !important;
	display: table;
}

@lslowikowska lslowikowska added the support:2 An issue reported by a commercially licensed client. label Jul 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support:2 An issue reported by a commercially licensed client. type:feature This issue reports a feature request (an idea for a new functionality or a missing option).
Projects
None yet
Development

No branches or pull requests

4 participants