bootstrap 的替代网格
Alternative grids with bootstrap
我想要一个响应式网格系统,它可以将我的标题连接到具有最小媒体查询的所有行。我知道 bootstrap 中有一些解决方案,例如本页 http://exisweb.net/responsive-table-plugins-and-patterns.
中的解决方案
有人知道允许 bootstrap 使用此类功能的插件或方法吗?我已经检查过 http://startbootstrap.com/bootstrap-resources/ 但没有找到类似的东西。 acceptable 的另一种方法是在某个时候修复 table headers 以便浏览 table 的用户始终可以看到它们,即使他向下滚动整个页面。
试试这个!我不知道这是否正是您的意思:
@media only screen and (max-width: 800px) {
/* Force table to not be like tables anymore */
#no-more-tables table,
#no-more-tables thead,
#no-more-tables tbody,
#no-more-tables th,
#no-more-tables td,
#no-more-tables tr {
display: block;
}
/* Hide table headers (but not display: none;, for accessibility) */
#no-more-tables thead tr {
position: absolute;
top: -9999px;
left: -9999px;
}
#no-more-tables tr {
border: 1px solid #ccc;
}
#no-more-tables td {
/* Behave like a "row" */
border: none;
border-bottom: 1px solid #eee;
position: relative;
padding-left: 50%;
white-space: normal;
text-align: left;
}
#no-more-tables td:before {
/* Now like a table header */
position: absolute;
/* Top/left values mimic padding */
top: 6px;
left: 6px;
width: 45%;
padding-right: 10px;
white-space: nowrap;
text-align: left;
font-weight: bold;
}
/*
Label the data
*/
#no-more-tables td:before {
content: attr(data-title);
}
}
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Getting Started With Bootstrap</title>
<link rel="stylesheet" href="css/bootstrap.min.css">
</head>
<body>
<div class="container">
<div class="row">
<div id="no-more-tables">
<table class="col-md-12 table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Code</th>
<th>Company</th>
<th class="number">Price</th>
<th class="number">Change</th>
<th class="number">Change %</th>
<th class="number">Open</th>
<th class="number">High</th>
<th class="number">Low</th>
<th class="number">Volume</th>
</tr>
</thead>
<tbody>
<tr>
<td data-title="Code">AAC</td>
<td data-title="Company">AUSTRALIAN AGRICULTURAL COMPANY LIMITED.</td>
<td data-title="Price" class="number">.38</td>
<td data-title="Change" class="number">-0.01</td>
<td data-title="Change %" class="number">-0.36%</td>
<td data-title="Open" class="number">.39</td>
<td data-title="High" class="number">.39</td>
<td data-title="Low" class="number">.38</td>
<td data-title="Volume" class="number">9,395</td>
</tr>
<tr>
<td data-title="Code">AAD</td>
<td data-title="Company">ARDENT LEISURE GROUP</td>
<td data-title="Price" class="number">.15</td>
<td data-title="Change" class="number">+0.02</td>
<td data-title="Change %" class="number">1.32%</td>
<td data-title="Open" class="number">.14</td>
<td data-title="High" class="number">.15</td>
<td data-title="Low" class="number">.13</td>
<td data-title="Volume" class="number">56,431</td>
</tr>
<tr>
<td data-title="Code">AAX</td>
<td data-title="Company">AUSENCO LIMITED</td>
<td data-title="Price" class="number">.00</td>
<td data-title="Change" class="number">-0.04</td>
<td data-title="Change %" class="number">-0.99%</td>
<td data-title="Open" class="number">.01</td>
<td data-title="High" class="number">.05</td>
<td data-title="Low" class="number">.00</td>
<td data-title="Volume" class="number">90,641</td>
</tr>
<tr>
<td data-title="Code">ABC</td>
<td data-title="Company">ADELAIDE BRIGHTON LIMITED</td>
<td data-title="Price" class="number">.00</td>
<td data-title="Change" class="number">+0.06</td>
<td data-title="Change %" class="number">2.04%</td>
<td data-title="Open" class="number">.98</td>
<td data-title="High" class="number">.00</td>
<td data-title="Low" class="number">.96</td>
<td data-title="Volume" class="number">862,518</td>
</tr>
<tr>
<td data-title="Code">ABP</td>
<td data-title="Company">ABACUS PROPERTY GROUP</td>
<td data-title="Price" class="number">.91</td>
<td data-title="Change" class="number">0.00</td>
<td data-title="Change %" class="number">0.00%</td>
<td data-title="Open" class="number">.92</td>
<td data-title="High" class="number">.93</td>
<td data-title="Low" class="number">.90</td>
<td data-title="Volume" class="number">595,701</td>
</tr>
<tr>
<td data-title="Code">ABY</td>
<td data-title="Company">ADITYA BIRLA MINERALS LIMITED</td>
<td data-title="Price" class="number">[=11=].77</td>
<td data-title="Change" class="number">+0.02</td>
<td data-title="Change %" class="number">2.00%</td>
<td data-title="Open" class="number">[=11=].76</td>
<td data-title="High" class="number">[=11=].77</td>
<td data-title="Low" class="number">[=11=].76</td>
<td data-title="Volume" class="number">54,567</td>
</tr>
<tr>
<td data-title="Code">ACR</td>
<td data-title="Company">ACRUX LIMITED</td>
<td data-title="Price" class="number">.71</td>
<td data-title="Change" class="number">+0.01</td>
<td data-title="Change %" class="number">0.14%</td>
<td data-title="Open" class="number">.70</td>
<td data-title="High" class="number">.72</td>
<td data-title="Low" class="number">.68</td>
<td data-title="Volume" class="number">191,373</td>
</tr>
<tr>
<td data-title="Code">ADU</td>
<td data-title="Company">ADAMUS RESOURCES LIMITED</td>
<td data-title="Price" class="number">[=11=].72</td>
<td data-title="Change" class="number">0.00</td>
<td data-title="Change %" class="number">0.00%</td>
<td data-title="Open" class="number">[=11=].73</td>
<td data-title="High" class="number">[=11=].74</td>
<td data-title="Low" class="number">[=11=].72</td>
<td data-title="Volume" class="number">8,602,291</td>
</tr>
<tr>
<td data-title="Code">AGG</td>
<td data-title="Company">ANGLOGOLD ASHANTI LIMITED</td>
<td data-title="Price" class="number">.81</td>
<td data-title="Change" class="number">-0.22</td>
<td data-title="Change %" class="number">-2.74%</td>
<td data-title="Open" class="number">.82</td>
<td data-title="High" class="number">.82</td>
<td data-title="Low" class="number">.81</td>
<td data-title="Volume" class="number">148</td>
</tr>
<tr>
<td data-title="Code">AGK</td>
<td data-title="Company">AGL ENERGY LIMITED</td>
<td data-title="Price" class="number">.82</td>
<td data-title="Change" class="number">+0.02</td>
<td data-title="Change %" class="number">0.14%</td>
<td data-title="Open" class="number">.83</td>
<td data-title="High" class="number">.83</td>
<td data-title="Low" class="number">.67</td>
<td data-title="Volume" class="number">846,403</td>
</tr>
<tr>
<td data-title="Code">AGO</td>
<td data-title="Company">ATLAS IRON LIMITED</td>
<td data-title="Price" class="number">.17</td>
<td data-title="Change" class="number">-0.02</td>
<td data-title="Change %" class="number">-0.47%</td>
<td data-title="Open" class="number">.11</td>
<td data-title="High" class="number">.22</td>
<td data-title="Low" class="number">.10</td>
<td data-title="Volume" class="number">5,416,303</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<script src="js/jquery.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>
我想要一个响应式网格系统,它可以将我的标题连接到具有最小媒体查询的所有行。我知道 bootstrap 中有一些解决方案,例如本页 http://exisweb.net/responsive-table-plugins-and-patterns.
中的解决方案有人知道允许 bootstrap 使用此类功能的插件或方法吗?我已经检查过 http://startbootstrap.com/bootstrap-resources/ 但没有找到类似的东西。 acceptable 的另一种方法是在某个时候修复 table headers 以便浏览 table 的用户始终可以看到它们,即使他向下滚动整个页面。
试试这个!我不知道这是否正是您的意思:
@media only screen and (max-width: 800px) {
/* Force table to not be like tables anymore */
#no-more-tables table,
#no-more-tables thead,
#no-more-tables tbody,
#no-more-tables th,
#no-more-tables td,
#no-more-tables tr {
display: block;
}
/* Hide table headers (but not display: none;, for accessibility) */
#no-more-tables thead tr {
position: absolute;
top: -9999px;
left: -9999px;
}
#no-more-tables tr {
border: 1px solid #ccc;
}
#no-more-tables td {
/* Behave like a "row" */
border: none;
border-bottom: 1px solid #eee;
position: relative;
padding-left: 50%;
white-space: normal;
text-align: left;
}
#no-more-tables td:before {
/* Now like a table header */
position: absolute;
/* Top/left values mimic padding */
top: 6px;
left: 6px;
width: 45%;
padding-right: 10px;
white-space: nowrap;
text-align: left;
font-weight: bold;
}
/*
Label the data
*/
#no-more-tables td:before {
content: attr(data-title);
}
}
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Getting Started With Bootstrap</title>
<link rel="stylesheet" href="css/bootstrap.min.css">
</head>
<body>
<div class="container">
<div class="row">
<div id="no-more-tables">
<table class="col-md-12 table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Code</th>
<th>Company</th>
<th class="number">Price</th>
<th class="number">Change</th>
<th class="number">Change %</th>
<th class="number">Open</th>
<th class="number">High</th>
<th class="number">Low</th>
<th class="number">Volume</th>
</tr>
</thead>
<tbody>
<tr>
<td data-title="Code">AAC</td>
<td data-title="Company">AUSTRALIAN AGRICULTURAL COMPANY LIMITED.</td>
<td data-title="Price" class="number">.38</td>
<td data-title="Change" class="number">-0.01</td>
<td data-title="Change %" class="number">-0.36%</td>
<td data-title="Open" class="number">.39</td>
<td data-title="High" class="number">.39</td>
<td data-title="Low" class="number">.38</td>
<td data-title="Volume" class="number">9,395</td>
</tr>
<tr>
<td data-title="Code">AAD</td>
<td data-title="Company">ARDENT LEISURE GROUP</td>
<td data-title="Price" class="number">.15</td>
<td data-title="Change" class="number">+0.02</td>
<td data-title="Change %" class="number">1.32%</td>
<td data-title="Open" class="number">.14</td>
<td data-title="High" class="number">.15</td>
<td data-title="Low" class="number">.13</td>
<td data-title="Volume" class="number">56,431</td>
</tr>
<tr>
<td data-title="Code">AAX</td>
<td data-title="Company">AUSENCO LIMITED</td>
<td data-title="Price" class="number">.00</td>
<td data-title="Change" class="number">-0.04</td>
<td data-title="Change %" class="number">-0.99%</td>
<td data-title="Open" class="number">.01</td>
<td data-title="High" class="number">.05</td>
<td data-title="Low" class="number">.00</td>
<td data-title="Volume" class="number">90,641</td>
</tr>
<tr>
<td data-title="Code">ABC</td>
<td data-title="Company">ADELAIDE BRIGHTON LIMITED</td>
<td data-title="Price" class="number">.00</td>
<td data-title="Change" class="number">+0.06</td>
<td data-title="Change %" class="number">2.04%</td>
<td data-title="Open" class="number">.98</td>
<td data-title="High" class="number">.00</td>
<td data-title="Low" class="number">.96</td>
<td data-title="Volume" class="number">862,518</td>
</tr>
<tr>
<td data-title="Code">ABP</td>
<td data-title="Company">ABACUS PROPERTY GROUP</td>
<td data-title="Price" class="number">.91</td>
<td data-title="Change" class="number">0.00</td>
<td data-title="Change %" class="number">0.00%</td>
<td data-title="Open" class="number">.92</td>
<td data-title="High" class="number">.93</td>
<td data-title="Low" class="number">.90</td>
<td data-title="Volume" class="number">595,701</td>
</tr>
<tr>
<td data-title="Code">ABY</td>
<td data-title="Company">ADITYA BIRLA MINERALS LIMITED</td>
<td data-title="Price" class="number">[=11=].77</td>
<td data-title="Change" class="number">+0.02</td>
<td data-title="Change %" class="number">2.00%</td>
<td data-title="Open" class="number">[=11=].76</td>
<td data-title="High" class="number">[=11=].77</td>
<td data-title="Low" class="number">[=11=].76</td>
<td data-title="Volume" class="number">54,567</td>
</tr>
<tr>
<td data-title="Code">ACR</td>
<td data-title="Company">ACRUX LIMITED</td>
<td data-title="Price" class="number">.71</td>
<td data-title="Change" class="number">+0.01</td>
<td data-title="Change %" class="number">0.14%</td>
<td data-title="Open" class="number">.70</td>
<td data-title="High" class="number">.72</td>
<td data-title="Low" class="number">.68</td>
<td data-title="Volume" class="number">191,373</td>
</tr>
<tr>
<td data-title="Code">ADU</td>
<td data-title="Company">ADAMUS RESOURCES LIMITED</td>
<td data-title="Price" class="number">[=11=].72</td>
<td data-title="Change" class="number">0.00</td>
<td data-title="Change %" class="number">0.00%</td>
<td data-title="Open" class="number">[=11=].73</td>
<td data-title="High" class="number">[=11=].74</td>
<td data-title="Low" class="number">[=11=].72</td>
<td data-title="Volume" class="number">8,602,291</td>
</tr>
<tr>
<td data-title="Code">AGG</td>
<td data-title="Company">ANGLOGOLD ASHANTI LIMITED</td>
<td data-title="Price" class="number">.81</td>
<td data-title="Change" class="number">-0.22</td>
<td data-title="Change %" class="number">-2.74%</td>
<td data-title="Open" class="number">.82</td>
<td data-title="High" class="number">.82</td>
<td data-title="Low" class="number">.81</td>
<td data-title="Volume" class="number">148</td>
</tr>
<tr>
<td data-title="Code">AGK</td>
<td data-title="Company">AGL ENERGY LIMITED</td>
<td data-title="Price" class="number">.82</td>
<td data-title="Change" class="number">+0.02</td>
<td data-title="Change %" class="number">0.14%</td>
<td data-title="Open" class="number">.83</td>
<td data-title="High" class="number">.83</td>
<td data-title="Low" class="number">.67</td>
<td data-title="Volume" class="number">846,403</td>
</tr>
<tr>
<td data-title="Code">AGO</td>
<td data-title="Company">ATLAS IRON LIMITED</td>
<td data-title="Price" class="number">.17</td>
<td data-title="Change" class="number">-0.02</td>
<td data-title="Change %" class="number">-0.47%</td>
<td data-title="Open" class="number">.11</td>
<td data-title="High" class="number">.22</td>
<td data-title="Low" class="number">.10</td>
<td data-title="Volume" class="number">5,416,303</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<script src="js/jquery.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>