Resume the min-width of the tables.

It was lost by mistake while fixing #85
This commit is contained in:
Cotes Chung 2020-08-15 00:35:00 +08:00
parent 0809e2b132
commit 188d8ffc69
5 changed files with 56 additions and 42 deletions

View file

@ -1,12 +0,0 @@
<!--
Fixed kramdown code highlight rendering:
https://github.com/penibelst/jekyll-compress-html/issues/101
https://github.com/penibelst/jekyll-compress-html/issues/71#issuecomment-188144901
-->
{% if include.content contains '<pre class="highlight">' %}
{% assign content = include.content | replace: '<pre class="highlight"><code', '<code' %}
{% assign content = content | replace: '</code></pre>', '</code>' %}
{{ content }}
{% else %}
{{ include.content }}
{% endif %}

View file

@ -0,0 +1,27 @@
<!--
Refactor the HTML structure.
-->
{% assign _content = include.content %}
<!--
Suroundding the markdown table with '<div class="table-wrapper">. and '</div>'
-->
{% if _content contains '<table>' %}
{% assign _content = _content | replace: '<table>', '<div class="table-wrapper"><table>' %}
{% assign _content = _content | replace: '</table>', '</table></div>' %}
{% assign _content = _content | replace: '</table></div></code>', '</table></code>' %}
{% endif %}
<!--
Fixed kramdown code highlight rendering:
https://github.com/penibelst/jekyll-compress-html/issues/101
https://github.com/penibelst/jekyll-compress-html/issues/71#issuecomment-188144901
-->
{% if _content contains '<pre class="highlight">' %}
{% assign _content = _content | replace: '<pre class="highlight"><code', '<code' %}
{% assign _content = _content | replace: '</code></pre>', '</code>' %}
{% endif %}
{{ _content }}

View file

@ -36,7 +36,7 @@ layout: compress
<div id="main-wrapper"> <div id="main-wrapper">
<div id="main"> <div id="main">
{% include fixlinenos.html content=content %} {% include refactor-content.html content=content %}
{% include footer.html %} {% include footer.html %}

View file

@ -750,22 +750,24 @@ a {
/*--- Begin of Markdown table style ---*/ /*--- Begin of Markdown table style ---*/
div.post-content .table-wrapper {
div.post-content { overflow-x: auto;
>table, li>table {
min-width: 60%; >table {
display: block; min-width: 60%;
overflow-x: auto; overflow-x: auto;
border-collapse: collapse;
border-spacing: 0; border-spacing: 0;
margin-bottom: 1.5rem; margin-bottom: 1.5rem;
thead {
border-bottom: solid 2px rgba(210, 215, 217, 0.75);
th {
@extend %table-cell;
} }
} }
table { tbody {
thead { tr {
border-bottom: solid 2px rgba(210, 215, 217, 0.75);
+tbody tr {
&:nth-child(2n) { &:nth-child(2n) {
background-color: var(--tb-even-bg); background-color: var(--tb-even-bg);
} }
@ -775,17 +777,14 @@ table {
& { & {
border-bottom: 1px solid var(--tb-border-color); border-bottom: 1px solid var(--tb-border-color);
} }
} td {
th {
@extend %table-cell; @extend %table-cell;
} }
} }
}
tbody td { }
@extend %table-cell;
} }
} // table
/*--- post ---*/ /*--- post ---*/

View file

@ -15,7 +15,7 @@
} }
%table-cell { %table-cell {
padding: .35rem .8rem; padding: .4rem 1rem;
font-size: 95%; font-size: 95%;
} }