来源:http://www.cnblogs.com/ventlam/archive/2012/05/29/2520807.html
表格(Table)
可参考:http://twitter.github.com/bootstrap/base-css.html#tables
依然使用<table><tr><th><td>等标签来表现表格。主要提供了四个css的类来控制表格的边和结构。表2-1显示了bootstrap的table可选项。
名字
|
Class
|
描述
|
Default
|
None
|
没有样式,只有行和列
|
Basic
|
.table
|
只有在行间有竖线
|
Bordered
|
.table-bordered
|
圆角和添加外边框
|
Zebra-stripe
|
.table-striped
|
为奇数行添加淡灰色的背景色
|
Condensed
|
.table-condensed
|
将横向的 padding 对切
|
表2-1 表格选项(Table Options)
我们可以将这些CSS类结合起来使用,如图2-4所示,显示一个混合的表格:
表单(Forms)
Bootstrap的表单是非常惊艳的部分。最好的地方在于你如何使用这些hmtl标签,它都会有很好的表现效果,而且不需要其他多余的代码。无论多复杂的布局都可以根据这些简洁,可扩展,事件绑定的要素来轻易实现。主要提供了四四种表单选项,如表2-2所示:
名字
|
Class
|
描述
|
Vertical (default)
|
.form-vertical (not required)
|
堆放式, 可控制的左对齐标签
|
Inline
|
.form-inline
|
左对齐标签和简约的内联控制块
|
Search
|
.form-search
|
放大的圆角,具有美感的搜索框
|
Horizontal
|
.form-horizontal
|
左漂浮, 右对齐标签
|
推荐到官方文档去体验下各种表单要素的真实效果,在chrome,Firefox等现代浏览器下显示十分优雅。同时可以使用.control-group来控制表单输入、错误等状态,需要wekit内核。如图2-5所示:
图2-5 表单状态控制
代码片段如下:
<div class="span8">
<form class="form-horizontal">
<fieldset>
<div class="control-group">
<label class="control-label" for="focusedInput">Focused input</label>
<div class="controls">
<input class="input-xlarge focused" id="focusedInput" type="text" value="This is focused…">
</div>
</div>
<div class="control-group">
<label class="control-label">Uneditable input</label>
<div class="controls">
<span class="input-xlarge uneditable-input">Some value here</span>
</div>
</div>
<div class="control-group">
<label class="control-label" for="disabledInput">Disabled input</label>
<div class="controls">
<input class="input-xlarge disabled" id="disabledInput" type="text" placeholder="Disabled input here…" disabled>
</div>
</div>
<div class="control-group">
<label class="control-label" for="optionsCheckbox2">Disabled checkbox</label>
<div class="controls">
<label class="checkbox">
<input type="checkbox" id="optionsCheckbox2" value="option1" disabled>
This is a disabled checkbox
</label>
</div>
</div>
<div class="control-group warning">
<label class="control-label" for="inputWarning">Input with warning</label>
<div class="controls">
<input type="text" id="inputWarning">
<span class="help-inline">Something may have gone wrong</span>
</div>
</div>
<div class="control-group error">
<label class="control-label" for="inputError">Input with error</label>
<div class="controls">
<input type="text" id="inputError">
<span class="help-inline">Please correct the error</span>
</div>
</div>
<div class="control-group success">
<label class="control-label" for="inputSuccess">Input with success</label>
<div class="controls">
<input type="text" id="inputSuccess">
<span class="help-inline">Woohoo!</span>
</div>
</div>
<div class="control-group success">
<label class="control-label" for="selectError">Select with success</label>
<div class="controls">
<select id="selectError">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</select>
<span class="help-inline">Woohoo!</span>
</div>
</div>
<div class="form-actions">
<button type="submit" class="btn btn-primary">Save changes</button>
<button class="btn">Cancel</button>
</div>
</fieldset>
</form>
</div>
</div>
分享到:
相关推荐
知识点bootstrapTable 刷新和查询配置 2.提升js代码性能 1.减少全局变量声明 2.缓存dom节点查找结果 3.局部变量缓存全局变量 /** * @param col bootstrapTable列表生成配置对象 */ var searchValue ={};//查询...
Bootstrap table还有一个很多强大的功能,下面就通过本文给大家分享基于Bootstrap table组件实现多层表头的实例代码,需要的朋友参考下吧
修改bootstrap table设置列宽问题,增加插件和bootstrap table组合可随意拖动表格的列宽
bootstrap table各个属性值的详细说明,中文翻译版本。
bootstrapTable组件的使用示例,里面包含父子表、treegrid以及结合knockoutjs的使用示例。博客园博主本人资源,有问题可以联系。
BootStrap Table两个Table数据之间行数据拖拽。
本人因为项目开发的需要,需要用到一个表格插件。于是看上了Bootstrap Table,官网只是给了一个例子,于是我把官网的代码给爬下来。在基础上进行自己的修改。如果有兴趣可以下载来看看,代码个官网的是一模一样的。
在之前做过的一个web项目中,前端表格是基于jQuery和Bootstrap Table实现的,要求能利用...Bootstrap Table可拖动列,需要用到它的Resizable扩展插件需要引入 bootstrap-table扩展插件 bootstrap-table-resizable.js
bootstrap table分页例子 bootstrap table实现了2种分页方式。
通过修改bootstrap table js 定制出自己的分页栏,样式仿照jqGrid样式,支持输入页码跳转
主要介绍了BootStrap Fileinput插件和Bootstrap table表格插件相结合实现文件上传、预览、提交的导入Excel数据操作步骤,需要的朋友可以参考下
使用 maven 创建的 基于 bootstrap table 的示例代码 使用 ajax 后台分页获取查询数据
bootstraptable父子表,子表找不到bootstraptable初始化方法的解决方案
Bootstraptable建立父子表 detailView: true 的折叠使用
Bootstrap Table 跨页选择,用于后台分页的表格,保存非当前页的勾选行数据,翻回去又可以自动勾选,又可通过函数获取勾选的全部数据。
Bootstrap+BootstrapTable+x-editable(css和js)整合包 内含 jq,js Bootstrap+BootstrapTable+x-editable内部的js 和css文件,一个整合包满足你的所有需求
实现了bootstrapTable 的列宽可鼠标拖动,方便查看列宽显示不完全的内容,前台js
bootstrap-table冻结列例子
本文通过实例代码给大家介绍了BootStrap Table复选框默认选中功能(从数据库获取到对应的状态进行判断是否为选中状态),代码简单易懂,非常不错,具有参考借鉴价值,需要的的朋友参考下吧