UNPKG

@ckeditor/ckeditor5-table

Version:

Table feature for CKEditor 5.

146 lines (121 loc) • 2.92 kB
/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options */ :root, :host { --ck-content-table-style-spacing: 1.5em; --ck-content-color-table-caption-background: #f7f7f7; --ck-content-color-table-caption-text: #333; } .ck-content { & .table th { text-align: start; } &[dir="rtl"] .table th { text-align: right; } &[dir="ltr"] .table th { text-align: left; } & figure.table:not(.layout-table) { display: table; & > table { width: 100%; height: 100%; } } & .table:not(.layout-table) { margin: .9em auto; } & table.table:not(.layout-table), & figure.table:not(.layout-table) > table { border-collapse: collapse; border-spacing: 0; border: 1px double #b3b3b3; & > thead, & > tfoot, & > tbody { & > tr { & > th { background: #0000000d; font-weight: bold; } & > td, & > th { & > p:first-of-type { margin-top: 0; } & > p:last-of-type { margin-bottom: 0; } border: 1px solid #bfbfbf; min-width: 2em; padding: .4em; } } } } } @media print { .ck-content figure.table { &:not(.layout-table) { width: fit-content; height: fit-content; } &:not(.layout-table) > table { height: initial; } } } .ck-content { & table.table.layout-table, & figure.table.layout-table { margin-top: 0; margin-bottom: 0; } & table.table.layout-table, & figure.table.layout-table > table { border-spacing: 0; } } .ck-content { & .table { &.table-style-align-left { float: left; margin-right: var(--ck-content-table-style-spacing); } &.table-style-align-right { float: right; margin-left: var(--ck-content-table-style-spacing); } &.table-style-align-center { margin-left: auto; margin-right: auto; } &.table-style-block-align-left { margin-left: 0; margin-right: auto; } &.table-style-block-align-right { margin-left: auto; margin-right: 0; } } } .ck-content .table > figcaption, .ck-content figure.table > table > caption { caption-side: top; word-break: normal; overflow-wrap: anywhere; text-align: center; color: var(--ck-content-color-table-caption-text); background-color: var(--ck-content-color-table-caption-background); outline-offset: -1px; padding: .6em; font-size: .75em; display: table-caption; @media (forced-colors: active) { background-color: unset; color: unset; } } .ck-content .table .ck-table-resized { table-layout: fixed; } .ck-content .table td, .ck-content .table th { overflow-wrap: break-word; } /*# sourceMappingURL=index-content.css.map */