diff --git a/addons/web/static/src/scss/layout_boxed.scss b/addons/web/static/src/scss/layout_boxed.scss
index 2077830c684908911013a62b22c70e512b4d2145..2a6132b6e1b35e4e94feaef9e4219ddf64535126 100644
--- a/addons/web/static/src/scss/layout_boxed.scss
+++ b/addons/web/static/src/scss/layout_boxed.scss
@@ -65,18 +65,18 @@
         background-color: gray('200');
     }
     /* compat 12.0 */
-    .row:not(#total) > div > table tr:not(:first-child):not(:last-child) td:last-child {
+    .row:not(#total) > div > table tbody tr:not(:last-child) td:last-child {
         background-color: gray('200');
     }
     /*Total table*/
     /* row div rule compat 12.0 */
     .row > div > table,
     div#total table {
+        thead tr:first-child,
+        tr.o_subtotal {
+            border-bottom: 1px solid gray('700');
+        }
         tr {
-            &:first-child,
-            &.o_subtotal {
-                border-bottom: 1px solid gray('700');
-            }
             &.o_subtotal{
                 td:first-child {
                     border-right: none;