diff --git a/lib/classes/Markup.class.php b/lib/classes/Markup.class.php index f329a92375cd1eb56bb1d75a79963ae3f846aec3..64aa5fe384ea2074fed5b5c8b2768a177044e0c2 100644 --- a/lib/classes/Markup.class.php +++ b/lib/classes/Markup.class.php @@ -342,6 +342,7 @@ class Markup 'link-extern', 'link-intern', 'math-tex', + 'table', 'usercode', 'wiki-link' ]); @@ -358,6 +359,7 @@ class Markup 'height', 'color', 'background-color', // needed by span, td + 'border-color', 'border-style', 'float', 'border' diff --git a/resources/assets/javascripts/chunks/wysiwyg.js b/resources/assets/javascripts/chunks/wysiwyg.js index ade573193055e38d4ad064bed48ed58b28eefa7f..7d9ccfc472f6aaa6427c7d5548ee29e056d44a8f 100644 --- a/resources/assets/javascripts/chunks/wysiwyg.js +++ b/resources/assets/javascripts/chunks/wysiwyg.js @@ -220,10 +220,21 @@ ClassicEditor.defaultConfig = { tableProperties: { borderColors: customColorPalette, backgroundColors: customColorPalette, + defaultProperties: { + alignment: 'left', + borderStyle: 'solid', + borderColor: '#666666', + borderWidth: '1px', + }, }, tableCellProperties: { borderColors: customColorPalette, backgroundColors: customColorPalette, + defaultProperties: { + borderStyle: 'solid', + borderColor: '#666666', + borderWidth: '1px', + }, }, }, typing: { diff --git a/resources/assets/stylesheets/scss/content.scss b/resources/assets/stylesheets/scss/content.scss index aca9cb0a96df5465f304de8cf155d7ffdc9ebb87..4769434f04da7be9ff593e3f527dc35f1d0bb743 100644 --- a/resources/assets/stylesheets/scss/content.scss +++ b/resources/assets/stylesheets/scss/content.scss @@ -55,18 +55,16 @@ white-space: pre-wrap; } - figure { + figure.table { display: table; margin: 0.9em auto; - table { - width: 100%; - height: 100%; - border-collapse: collapse; - border-spacing: 0; + &:not([style]) { + margin-inline-start: 0; + } + table { td { - border: unset; min-width: 2em; padding: 0.4em; } diff --git a/resources/assets/stylesheets/scss/studip-cke-ui.scss b/resources/assets/stylesheets/scss/studip-cke-ui.scss index a6cd72b68e933f85163f5e39eb4e15667850353d..65a29555276cfa1c6c0308948445fa9a1c61a4b2 100644 --- a/resources/assets/stylesheets/scss/studip-cke-ui.scss +++ b/resources/assets/stylesheets/scss/studip-cke-ui.scss @@ -260,6 +260,18 @@ a.ck.ck-button.ck-button_with-text.ck-dropdown__button:not(.ck-disabled):hover { border: 1px solid var(--dark-gray-color-60); } +/* table */ +.ck-content .table { + margin: 0.9em auto; +} +.ck-content .table { + margin: 0.9em auto; + + &:not([style]) { + margin-inline-start: 0; + } +} + /* StudipWikiLink plugin */ .ck.ck-studip-wiki-link-form { max-width: 100%; diff --git a/resources/assets/stylesheets/scss/typography.scss b/resources/assets/stylesheets/scss/typography.scss index e225c42cd403be48d3a31bfe1ea643595f67ca0c..0c2295d8842379d081f10490d9493fe83b600d99 100644 --- a/resources/assets/stylesheets/scss/typography.scss +++ b/resources/assets/stylesheets/scss/typography.scss @@ -69,7 +69,7 @@ h1, h2 { h1 { margin-top: 0; - span { + span:not([style]) { display: block; font-size: calc($font-size-h1 * 0.75); font-weight: calc($headings-font-weight / 7); diff --git a/resources/assets/stylesheets/studip.less b/resources/assets/stylesheets/studip.less index 1cb3da3db77952b44eeced3b97bb520a9479061a..d0ba0564472b6163486cc3f58a29319986d48cc5 100644 --- a/resources/assets/stylesheets/studip.less +++ b/resources/assets/stylesheets/studip.less @@ -45,6 +45,28 @@ table.content { border: thin solid #666; padding: 3px; } + + /* for CKE5 Table Border Colors */ + &[style*='border-color'] { + border-width: thin; + border-style: solid; + } + + td:first-child { + border-inline-start: unset; + } + + td:last-child { + border-inline-end: unset; + } + + tr:first-child td { + border-block-start: unset; + } + + tr:last-child td { + border-block-end: unset; + } }