Commit ac0ad881 authored by Jérome Perrin's avatar Jérome Perrin

gadget_html_viewer: only set a border for tables with border=1 attribute

gadget_html_viewer had styles to add a border for tables, so that they
look similar to tables added in CKEditor. One problem is that all tables
had borders, because HTML emails are often using tables to position the
content, when viewing an Mail Message from ERP5 back office interface
we could see all the borders, which looked a bit ugly.

These changes bring back a behavior closer to default style sheet of
browsers: tables have no border by default, but a rule is added to
emulate the rendering of border="1" attributes, so that tables edited
with CKEditor have borders and look the same in the editor or in the
html viewer.
parent 02e20a8c
Pipeline #25278 failed with stage
in 0 seconds
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
</item> </item>
<item> <item>
<key> <string>height</string> </key> <key> <string>height</string> </key>
<value> <int>281</int> </value> <value> <int>273</int> </value>
</item> </item>
<item> <item>
<key> <string>precondition</string> </key> <key> <string>precondition</string> </key>
......
...@@ -125,7 +125,6 @@ div[data-gadget-url$="gadget_html_viewer.html"] listing { ...@@ -125,7 +125,6 @@ div[data-gadget-url$="gadget_html_viewer.html"] listing {
div[data-gadget-url$="gadget_html_viewer.html"] table { div[data-gadget-url$="gadget_html_viewer.html"] table {
display: table; display: table;
border-spacing: 2px; border-spacing: 2px;
border: 1px solid #1F1F1F;
} }
div[data-gadget-url$="gadget_html_viewer.html"] thead { div[data-gadget-url$="gadget_html_viewer.html"] thead {
display: table-header-group; display: table-header-group;
...@@ -151,7 +150,6 @@ div[data-gadget-url$="gadget_html_viewer.html"] colgroup { ...@@ -151,7 +150,6 @@ div[data-gadget-url$="gadget_html_viewer.html"] colgroup {
div[data-gadget-url$="gadget_html_viewer.html"] tr { div[data-gadget-url$="gadget_html_viewer.html"] tr {
display: table-row; display: table-row;
vertical-align: middle; vertical-align: middle;
border: 1px solid #1F1F1F;
padding: 0 6pt; padding: 0 6pt;
} }
div[data-gadget-url$="gadget_html_viewer.html"] td, div[data-gadget-url$="gadget_html_viewer.html"] td,
...@@ -159,11 +157,16 @@ div[data-gadget-url$="gadget_html_viewer.html"] th { ...@@ -159,11 +157,16 @@ div[data-gadget-url$="gadget_html_viewer.html"] th {
display: table-cell; display: table-cell;
vertical-align: inherit; vertical-align: inherit;
padding: 0 6pt; padding: 0 6pt;
border: 1px solid #1F1F1F;
} }
div[data-gadget-url$="gadget_html_viewer.html"] th { div[data-gadget-url$="gadget_html_viewer.html"] th {
font-weight: bold; font-weight: bold;
} }
div[data-gadget-url$="gadget_html_viewer.html"] table[border="1"],
div[data-gadget-url$="gadget_html_viewer.html"] table[border="1"] tr,
div[data-gadget-url$="gadget_html_viewer.html"] table[border="1"] th,
div[data-gadget-url$="gadget_html_viewer.html"] table[border="1"] td {
border: 1px solid #1F1F1F;
}
div[data-gadget-url$="gadget_html_viewer.html"] caption { div[data-gadget-url$="gadget_html_viewer.html"] caption {
display: table-caption; display: table-caption;
text-align: -webkit-center; text-align: -webkit-center;
......
...@@ -140,7 +140,6 @@ div[data-gadget-url$="gadget_html_viewer.html"] { ...@@ -140,7 +140,6 @@ div[data-gadget-url$="gadget_html_viewer.html"] {
table { table {
display: table; display: table;
border-spacing: 2px; border-spacing: 2px;
border: 1px solid @colorforeground;
} }
thead { thead {
display: table-header-group; display: table-header-group;
...@@ -167,7 +166,6 @@ colgroup { ...@@ -167,7 +166,6 @@ colgroup {
tr { tr {
display: table-row; display: table-row;
vertical-align: middle; vertical-align: middle;
border: 1px solid @colorforeground;
padding: 0 @margin-size; padding: 0 @margin-size;
} }
...@@ -175,11 +173,18 @@ td, th { ...@@ -175,11 +173,18 @@ td, th {
display: table-cell; display: table-cell;
vertical-align: inherit; vertical-align: inherit;
padding: 0 @margin-size; padding: 0 @margin-size;
border: 1px solid @colorforeground;
} }
th { th {
font-weight: bold; font-weight: bold;
} }
table[border="1"],
table[border="1"] tr,
table[border="1"] th,
table[border="1"] td {
border: 1px solid @colorforeground;
}
caption { caption {
display: table-caption; display: table-caption;
text-align: -webkit-center; text-align: -webkit-center;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment