Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
K
kpp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alexandr Veselov
kpp
Commits
7fb44ad7
Commit
7fb44ad7
authored
Feb 16, 2016
by
Nikolay Gromov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
table-responsive
parent
89a6d02d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
73 additions
and
1 deletion
+73
-1
_blocks_library.html
src/_blocks_library.html
+24
-0
table-responsive.less
src/less/blocks/table-responsive.less
+44
-0
global_scaffolding.less
src/less/global_scaffolding.less
+3
-1
style.less
src/less/style.less
+2
-0
No files found.
src/_blocks_library.html
View file @
7fb44ad7
...
...
@@ -136,6 +136,30 @@
<hr>
</section>
<section>
<h2>
Исходное: Адаптивные таблицы
</h2>
<p>
Внимание! Адаптивные таблицы требуют добавления дата-атрибутов. Фиксация минимальной ширины имитатора
<code>
th
</code>
будет полезной.
</p>
<table
class=
"table-responsive"
>
<thead>
<tr>
<th>
Имя и фамилия
</th>
<th>
Тип мироощущения
</th>
</tr>
</thead>
<tbody>
<tr>
<td
data-label=
"Имя и фамилия"
>
Анатоле Вассерман
</td>
<td
data-label=
"Тип мироощущения"
>
Девственность
</td>
</tr>
<tr>
<td
data-label=
"Имя и фамилия"
>
Джакомо Казанова
</td>
<td
data-label=
"Тип мироощущения"
>
Небольшая распущенность с лёгкоё примесью леденящих душу извращений, чудовищной лжи и имитатора известного органа, обитого телячьей кожей.
</td>
</tr>
</tbody>
</table>
<hr>
</section>
<section>
<h2>
Исходное: Формы по умолчанию
</h2>
<form
action=
""
>
...
...
src/less/blocks/table-responsive.less
0 → 100644
View file @
7fb44ad7
//------------------------------------------------------------------------------
// Адаптивные таблицы (требуют наличия атрибутов data-label на тегах td)
//------------------------------------------------------------------------------
.table-responsive {
@media (max-width: (@screen-md - 1)) {
display: block;
border: 0;
overflow-x: auto; // IE11 отказывается переносить длинный текст в <td>, даём костыль
thead {
display: none;
}
tbody {
display: block;
width: 100%;
tr {
display: block;
border-top: 0;
&:not(:last-child) {
margin-bottom: @line-height;
}
}
td {
display: flex;
width: 100%;
&:before {
display: block;
padding-right: .5em;
font-weight: 700;
white-space: nowrap;
content: attr(data-label) + ":";
}
}
}
}
}
src/less/global_scaffolding.less
View file @
7fb44ad7
...
...
@@ -135,7 +135,8 @@ ol,
dl,
blockquote,
address,
figure {
figure,
table {
margin-top: (@line-height / 2);
margin-bottom: (@line-height / 2);
}
...
...
@@ -279,6 +280,7 @@ caption {
td,
th {
vertical-align: top;
border-bottom: 1px solid @border-color;
}
...
...
src/less/style.less
View file @
7fb44ad7
...
...
@@ -3,3 +3,5 @@
@import "global_scaffolding.less";
@import "global_grid.less";
@import "blocks/table-responsive.less";
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment