Creating a Pricing Table with Twitter Bootstrap 3 list group component
Objective
Pricing Tables are one of the essential components of any website selling products or service. Though Twitter Boortstrap 3 (like it's previous versions) does not have a Pricing Table component out of the box, it has list group component. The purpose of this component is to render complex and customized content. Leveraging that feature we will create a simple pricing table in this tutorial and along with an explanation of what CSS rules are used to make a list group and how to customize it.

How a typical looks like

You may view a live demo of the pictorial above here. And following is the code used for example.
list-group and list-group-item
list-group class has following CSS rules
badges
You may use badges component to embrace the list-group. The following code shows how to do that.
You may view live demo here. The CSS code used to place badges within list-goup is shown below.
Note that because of float:right, it is pushed to right-hand side of the actual content within a list group item.
Linked items
You may view live demo here. The CSS code used to place linked items within list group is shown below.
Custom content
This example shows list group with custom content. HTML and CSS code present in Bootstrap's css is shown below.
CSS code:
Pricing Table
Now, we will take the basic structure of list group component and convert it to a simple but attractive Pricing Table.
Following is the code containing basic HTML code we have used to create the Pricing Table. Note that we have added buttons within the last list items. For the left and right most columns, we have used Bootstrap's default button. For the center column, we have added the button with a different class(warning) so that it looks different from others. Further, we have also added a badge in the first list item of the center column.
Now we will customize the out of the box look and feel adding CSS classes. The first snippet of CSS code will add some top padding to the page.
And then, by adding the following CSS code we will customize background color, font color, text alignment and font size of the content within list items.
But we want to make the first list item of the center column look different. So, we add the following CSS code. We have used :first-child pseudo element for accessing the desired list item.
To make the badge look different, we then add the following CSS code.
You can view the working example here. And may download the code from the link placed at the begining of the tutorial.
Questions? Suggestions? Join the discussion below. For the upcoming tutorials, please subscribe to our Feed.
Previous: Twitter Bootstrap Alerts and Errors tutorial
Next:
How to center a div using Twitter Bootstrap 3