Bootstrap the form _javascript skills you must learn every day

Source: Internet
Author: User

This article is mainly to explain the table, this is actually for the people who have done the site, is not unfamiliar, and can be said to be the most commonly used in various lists of display, sometimes also because of the user or the boss's needs and feel headache. Now let's take a look at the types of forms that bootstrap has prepared for us. As shown below:

1. Basic cases
2. Striped Form
3. Table with Border
4. Mouse hover
5. Austerity forms
6. Status class
7. Response Form
8. Summary

Basic case
Add a. Table to any <table> tag to give it a basic style-a small amount of internal fill (padding), and a horizontal divider line. This way looks superfluous!? But we think that table elements are very extensive, and if we give them a default style that might affect plug-ins such as calendar and date selections, we choose to separate the styles.

A simple table example

 <div class= "Container" >
 <table class= "table" > 
 <caption>table Basic Cases </caption> 
 <thead> 
 <tr> 
  <th>first name</th> 
  <th>last name</th>
  <th >user name</th> 
 </tr> 
 </thead> 
 <tbody> 
 <tr> 
  <td> aehyok</td> 
  <td>leo</td> 
  <td> @aehyok </td> 
 </tr>
 <tr > 
  <td>lynn</td> 
  <td>thl</td> 
  <td> @lynn </td> 
 </tr >
 </tbody> 
 </table> 
 </div>

Striped form

Use. table-striped can increase the zebra stripe pattern for each of the same within <tbody>.
Add a style class to the table element on the example above
<table class= "Table table-striped" >
Look at the effect of the present, or a little change.

A table with borders
Use. table-bordered to add a border around the table and each cell in it.
Or add a style class to the table element in the first example
<table class= "Table table-bordered" >

Mouse hover
use. Table-hover to allow each row in <tbody> to respond to the mouse hover state.
<table class= "Table Table-hover" >
Move the mouse over that line and it works.

Austerity form
using. table-condensed can make the table more compact, and the interior of the cell (padding) will be halved.
<table class= "Table table-condensed" >
This effect is not so obvious, mainly is the contents of the cell padding halved.

Status class
These state classes allow you to set a color for the licensed cells.

<table class= "Table table-condensed" > <caption>Table</caption> <thead> <tr> <th >#</th> <th>first name</th> <th>last name</th> <th>user name</th> &L t;/tr> </thead> <tbody> <tr class= "active" > <td>1</td> <td>aehyok</td > <td>leo</td> <td> @aehyok </td> </tr> <tr class= "Success" > <td>2& lt;/td> <td>lynn</td> <td>thl</td> <td> @lynn </td> </tr> <tr CLA ss= "Warning" > <td>3</td> <td>Amdy</td> <td>Amy</td> <td> @Amdy < /td> </tr> <tr class= "Danger" > <td>4</td> <td>Amdy</td> &LT;TD&GT;AMY&L t;/td> <td> @Amdy </td> </tr> <tr > <td class= "Success" >5</td> &LT;TD CLA ss= "Danger" >amdy</td> <td class= "Warning" >Amy</td> <td class= "active" > @Amdy </td> </tr> </tbody& 
 Gt 

 </table>

Response table
wrapping any. Table in. table-responsive creates a responsive table that scrolls horizontally on a small screen device (less than 768px). The horizontal scroll bar disappears when the screen is larger than the 768px width.

<div class= "table-responsive" > <table class= "table" > <caption>Table</caption> <thead> <tr> <th>#</th> <th>first name</th> <th>last name</th> <th>us
  Er name</th> </tr> </thead> <tbody> <tr class= "active" > <td>1</td> <td>aehyok</td> <td>leo</td> <td> @aehyok </td> </tr> <tr class= "Succe 
 SS "> <td>2</td> <td>lynn</td> <td>thl</td> <td> @lynn </td>  
  </tr> <tr class= "Warning" > <td>3</td> <td>Amdy</td> <td>Amy</td> <td> @Amdy </td> </tr> <tr class= "Danger" > <td>4</td> <td>amdy</td > <td>Amy</td> <td> @Amdy </td> </tr> <tr > <td class= "Success" &GT;5&L T;/td> &LT;TD Class= "Danger" >Amdy</td> <td class= "Warning" >Amy</td> <td class= "active" > @Amdy </td> &L
 t;/tr> </tbody> </table> </div>

Look at the amount of scroll bar appearing.

A simple few style classes, you can get the page to this extent, very good, and no longer need to worry about the style.

If you want to further study, you can click here to learn, and then attach two wonderful topics: Bootstrap Learning Tutorials Bootstrap Practical course

The above is about bootstrap table most commonly used in various lists of the display, I hope to help you learn.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.