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
......@@ -16,7 +16,7 @@
</item>
<item>
<key> <string>height</string> </key>
<value> <int>281</int> </value>
<value> <int>273</int> </value>
</item>
<item>
<key> <string>precondition</string> </key>
......
......@@ -125,7 +125,6 @@ div[data-gadget-url$="gadget_html_viewer.html"] listing {
div[data-gadget-url$="gadget_html_viewer.html"] table {
display: table;
border-spacing: 2px;
border: 1px solid #1F1F1F;
}
div[data-gadget-url$="gadget_html_viewer.html"] thead {
display: table-header-group;
......@@ -151,7 +150,6 @@ div[data-gadget-url$="gadget_html_viewer.html"] colgroup {
div[data-gadget-url$="gadget_html_viewer.html"] tr {
display: table-row;
vertical-align: middle;
border: 1px solid #1F1F1F;
padding: 0 6pt;
}
div[data-gadget-url$="gadget_html_viewer.html"] td,
......@@ -159,11 +157,16 @@ div[data-gadget-url$="gadget_html_viewer.html"] th {
display: table-cell;
vertical-align: inherit;
padding: 0 6pt;
border: 1px solid #1F1F1F;
}
div[data-gadget-url$="gadget_html_viewer.html"] th {
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 {
display: table-caption;
text-align: -webkit-center;
......
......@@ -140,7 +140,6 @@ div[data-gadget-url$="gadget_html_viewer.html"] {
table {
display: table;
border-spacing: 2px;
border: 1px solid @colorforeground;
}
thead {
display: table-header-group;
......@@ -167,7 +166,6 @@ colgroup {
tr {
display: table-row;
vertical-align: middle;
border: 1px solid @colorforeground;
padding: 0 @margin-size;
}
......@@ -175,11 +173,18 @@ td, th {
display: table-cell;
vertical-align: inherit;
padding: 0 @margin-size;
border: 1px solid @colorforeground;
}
th {
font-weight: bold;
}
table[border="1"],
table[border="1"] tr,
table[border="1"] th,
table[border="1"] td {
border: 1px solid @colorforeground;
}
caption {
display: table-caption;
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