Css 引导表有什么主题或风格吗?
我现在使用Bootstrap来创建我正在开发的网站的前端,Bootstrap非常好而且功能强大。但是,HTML表的默认样式和主题没有那么好那么它有什么风格或主题吗?Css 引导表有什么主题或风格吗?,css,twitter-bootstrap-3,html-table,Css,Twitter Bootstrap 3,Html Table,我现在使用Bootstrap来创建我正在开发的网站的前端,Bootstrap非常好而且功能强大。但是,HTML表的默认样式和主题没有那么好那么它有什么风格或主题吗? 我搜索了一下,找到了一个网站。它们为引导提供了非常好的免费主题,但是,这些主题不会改变表的样式。引导为带有.table类的表提供基本样式。还可以添加其他类以获得额外的、适度的样式 推特引导表可以设置样式并精心设计。然而,要使您的表格看起来漂亮和时尚,您需要创建自己的css 你可以遵循这个例子 在你的HTML上 <table c
我搜索了一下,找到了一个网站。它们为引导提供了非常好的免费主题,但是,这些主题不会改变表的样式。引导为带有
.table
类的表提供基本样式。还可以添加其他类以获得额外的、适度的样式
推特引导表可以设置样式并精心设计。然而,要使您的表格看起来漂亮和时尚,您需要创建自己的css 你可以遵循这个例子 在你的HTML上
<table class="responsive-table responsive-table-input-matrix">
<tr>
<th>Role</th>
<th>Add to Page</th>
<th>Configure</th>
<th>View</th>
<th>Change Permissions</th>
</tr>
<tr>
<td data-th="Role">Guest</td>
<td data-th="Add to Page"><input type="checkbox" /></td>
<td data-th="Configure"><input type="checkbox" /></td>
<td data-th="View"><input type="checkbox" /></td>
<td data-th="Change Permissions"><input type="checkbox" /></td>
</tr>
<tr>
<td data-th="Role">Noob</td>
<td data-th="Add to Page"><input type="checkbox" /></td>
<td data-th="Configure"><input type="checkbox" /></td>
<td data-th="View"><input type="checkbox" /></td>
<td data-th="Change Permissions"><input type="checkbox" /></td>
</tr>
<tr>
<td data-th="Role">Moderator</td>
<td data-th="Add to Page"><input type="checkbox" /></td>
<td data-th="Configure"><input type="checkbox" /></td>
<td data-th="View"><input type="checkbox" /></td>
<td data-th="Change Permissions"><input type="checkbox" /></td>
</tr>
<tr>
<td data-th="Role">Administrator</td>
<td data-th="Add to Page"><input type="checkbox" /></td>
<td data-th="Configure"><input type="checkbox" /></td>
<td data-th="View"><input type="checkbox" /></td>
<td data-th="Change Permissions"><input type="checkbox" /></td>
</tr>
<tr>
<td data-th="Role">Owner</td>
<td data-th="Add to Page"><input type="checkbox" /></td>
<td data-th="Configure"><input type="checkbox" /></td>
<td data-th="View"><input type="checkbox" /></td>
<td data-th="Change Permissions"><input type="checkbox" /></td>
</tr>
</table>
希望您能从这个编码中学到一些东西。:) 谢谢你的帮助。我真的在寻找一个风格不同于基本引导表的现成的引导表示例。您能澄清一下“HTML表没有那么好”吗?非常感谢您的帮助。你的桌子看起来不错。你可以参考一些有用的资源来创建引导HTML表的样式吗?Hi@Tech Lover,更多信息可以在这里参考
@import "compass/css3";
// More practical CSS...
// using mobile first method (IE8,7 requires respond.js polyfill https://github.com/scottjehl/Respond)
$breakpoint-alpha: 480px; // adjust to your needs
.responsive-table-input-matrix {
margin: 1em 0;
// min-width: 300px; // adjust to your needs
width: 100%;
@media (min-width: $breakpoint-alpha) {
.responsive-table-input-matrix {
width: auto;
}
}
tr {
border-top: 1px solid #ddd;
border-bottom: 1px solid #ddd;
td {
text-align: left;
@media (min-width: $breakpoint-alpha) {
text-align: center;
}
}
& td:first-of-type {
text-align: left;
}
}
th {
display: none; // for accessibility, use a visually hidden method here instead! Thanks, reddit!
}
td {
display: block;
&:first-child {
padding-top: .5em;
}
&:last-child {
padding-bottom: .5em;
}
&:before {
content: attr(data-th)": "; // who knew you could do this? The internet, that's who.
font-weight: bold;
// optional stuff to make it look nicer
width: 9em; // magic number :( adjust according to your own content
display: inline-block;
// end options
@media (min-width: $breakpoint-alpha) {
display: none;
}
}
}
& th:first-of-type {
text-align: left;
}
th, td {
text-align: center;
@media (min-width: $breakpoint-alpha) {
display: table-cell;
padding: .25em .5em;
&:first-child {
padding-left: 0;
}
&:last-child {
padding-right: 0;
}
}
}
}
// presentational styling
@import 'http://fonts.googleapis.com/css?family=Montserrat:300,400,700';
body {
padding: 0 2em;
font-family: Montserrat, sans-serif;
-webkit-font-smoothing: antialiased;
text-rendering: optimizeLegibility;
color: #444;
background: #eee;
}
h1 {
font-weight: normal;
letter-spacing: -1px;
color: #34495E;
}
.responsive-table {
background: #34495E;
color: #fff;
border-radius: .4em;
overflow: hidden;
tr {
border-color: lighten(#34495E, 10%);
}
th, td {
margin: .5em 1em;
@media (min-width: $breakpoint-alpha) {
padding: 1em !important;
}
}
th, td:before {
color: #dd5;
}
}