From 94f2aaf9648992ffcb72368cbef4e27ce92badbb Mon Sep 17 00:00:00 2001
From: Silvio Giebl <silvio.giebl@dc-square.de>
Date: Sat, 4 May 2019 23:18:56 +0200
Subject: [PATCH] Added table wrappers, fixed anchor headings

---
 _layouts/anchor_headings.html |  5 -----
 _layouts/default.html         |  5 +++--
 _layouts/table_wrappers.html  |  7 +++++++
 _sass/tables.scss             | 11 ++++++-----
 4 files changed, 16 insertions(+), 12 deletions(-)
 delete mode 100644 _layouts/anchor_headings.html
 create mode 100644 _layouts/table_wrappers.html

diff --git a/_layouts/anchor_headings.html b/_layouts/anchor_headings.html
deleted file mode 100644
index efec628f..00000000
--- a/_layouts/anchor_headings.html
+++ /dev/null
@@ -1,5 +0,0 @@
----
-layout: vendor/compress
----
-
-{% include vendor/anchor_headings.html html=content anchorBody="#" anchorClass="anchor_heading" %}
\ No newline at end of file
diff --git a/_layouts/default.html b/_layouts/default.html
index 0b3928d6..0ee5dcc5 100644
--- a/_layouts/default.html
+++ b/_layouts/default.html
@@ -1,5 +1,5 @@
 ---
-layout: anchor_headings
+layout: table_wrappers
 ---
 
 <!DOCTYPE html>
@@ -57,7 +57,8 @@ layout: anchor_headings
           {% endif %}
         {% endunless %}
         <div id="main-content" class="page-content" role="main">
-          {{ content }}
+
+          {% include vendor/anchor_headings.html html=content anchorBody="#" anchorClass="anchor_heading" %}
 
           {% if page.has_children == true and page.has_toc != false %}
           <hr>
diff --git a/_layouts/table_wrappers.html b/_layouts/table_wrappers.html
new file mode 100644
index 00000000..cc6187ad
--- /dev/null
+++ b/_layouts/table_wrappers.html
@@ -0,0 +1,7 @@
+---
+layout: vendor/compress
+---
+
+{% assign content_ = content | replace: '<table', '<div class="table-wrapper"><table' %}
+{% assign content_ = content_ | replace: '</table>', '</table></div>' %}
+{{ content_ }}
\ No newline at end of file
diff --git a/_sass/tables.scss b/_sass/tables.scss
index 39bc0dc3..c5be6063 100644
--- a/_sass/tables.scss
+++ b/_sass/tables.scss
@@ -3,18 +3,19 @@
 //
 // stylelint-disable max-nesting-depth, selector-no-type, selector-max-type
 
-table {
+.table-wrapper {
   display: block;
   width: 100%;
   max-width: 100%;
   margin-bottom: $sp-5;
   overflow-x: auto;
-  border-collapse: separate;
   box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07), 0 4px 14px rgba(0, 0, 0, 0.05);
+}
 
-  @include mq(sm) {
-    display: table;
-  }
+table {
+  display: table;
+  min-width: 100%;
+  border-collapse: separate;
 }
 
 th,
-- 
GitLab