Skip to main content

HOW TO BUILD A COOL TABLE DESIGN WITH CSS3

Today I will show you how to create a very smart looking table which can be used for whatever you like on your website. In this instance I have used it as a web hosting pricing table
STEP 1: THE MARKUP

Let’s first start with the HTML. Here we have a simple table markup using the general elements: < table >, < tr >< /tr >, < td >< /td >, < thead >, < tbody >, < tfoot >. I have added classes to some of the table elements, you will see the styling in part 2 with the CSS.

We then need to input some data into the table, here I have just made up some figures for some web hosting packages.

<table class="pricingtable">
<thead>
<tr>
<th></th>
<th class="bronze" scope="col">Bronze</th>
<th class="silver" scope="col">Silver</th>
<th class="gold" scope="col">Gold</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Disk Space</th>
<td><strong>500MB</strong> Disk Space</td>
<td><strong>2GB</strong> Disk Space</td>
<td><strong>5GB</strong> Disk Space</td>
</tr>
<tr>
<th scope="row">Bandwidth</th>
<td>5GB</td>
<td>25GB</td>
<td>50GB</td>
</tr>
<tr>
<th scope="row">MySQL DB</th>
<td>2</td>
<td>10</td>
<td>50</td>
</tr>
<tr>
<th scope="row">Emails</th>
<td>5</td>
<td>20</td>
<td>Unlimited</td>
</tr>
<tr>
<th scope="row">Domains</th>
<td>2</td>
<td>10</td>
<td>50</td>
</tr>
<tr>
<th scope="row">24/7 Support</th>
<td><span class="cross"></span></td>
<td><span class="cross"></span></td>
<td><span class="tick"></span></td>
</tr>
<tr>
<th scope="row">PHP 5</th>
<td><span class="cross"></span></td>
<td><span class="tick"></span></td>
<td><span class="tick"></span></td>
</tr>
</tbody>
<tfoot>
<tr>
<th scope="row">Price per month</th>
<td>£ 2.99</td>
<td>£ 5.99</td>
<td>£ 9.99</td>
</tr>
</tfoot>
</table>
STEP 2: THE CSS

Now we have the CSS. In my < thead > section I have styled each header a different colour representing “Bronze, Silver, Gold” The gradients in the table are purely CSS, I have usedColorzilla: Ultimate CSS Gradient Generator to produce the CSS gradients. I would recommend using that generator when re-styling your tables gradients, unless you don’t want to use gradients at all.

I have also added border-radius to the Table Headers which give it another nice effect.

body { background: #3b3b3b;
}
table.pricingtable {
border-collapse:separate;
border-spacing: 0;
width: 100%;
}

.pricingtable thead th:empty{
background:transparent;
border:none;
}
.pricingtable thead th {
padding: 10px 10px;
text-transform: uppercase;
}
.pricingtable tbody td{
font:12px Arial, Helvetica, sans-serif;
color:#222222;
text-shadow:0 1px 1px #fff;
padding:10px;
text-align:center;
border:1px solid #3b3b3b;
background: #ffffff; /* Old browsers */
background: -moz-linear-gradient(top, #ffffff 0%, #f3f3f3 50%, #ededed 51%, #ffffff 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(50%,#f3f3f3), color-stop(51%,#ededed), color-stop(100%,#ffffff)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #ffffff 0%,#f3f3f3 50%,#ededed 51%,#ffffff 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #ffffff 0%,#f3f3f3 50%,#ededed 51%,#ffffff 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #ffffff 0%,#f3f3f3 50%,#ededed 51%,#ffffff 100%); /* IE10+ */
background: linear-gradient(to bottom, #ffffff 0%,#f3f3f3 50%,#ededed 51%,#ffffff 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#ffffff',GradientType=0 ); /* IE6-9 */
}
.pricingtable tbody th {
font:14px Arial, Helvetica, sans-serif;
padding: 10px;
border:1px solid #3b3b3b;
-moz-border-radius:10px 0px 0px 10px;
-webkit-border-top-left-radius:10px;
-webkit-border-bottom-left-radius:10px;
border-top-left-radius:10px;
border-bottom-left-radius:10px;
background: #ffffff; /* Old browsers */
background: -moz-linear-gradient(top, #ffffff 0%, #f3f3f3 50%, #ededed 51%, #ffffff 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(50%,#f3f3f3), color-stop(51%,#ededed), color-stop(100%,#ffffff)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #ffffff 0%,#f3f3f3 50%,#ededed 51%,#ffffff 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #ffffff 0%,#f3f3f3 50%,#ededed 51%,#ffffff 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #ffffff 0%,#f3f3f3 50%,#ededed 51%,#ffffff 100%); /* IE10+ */
background: linear-gradient(to bottom, #ffffff 0%,#f3f3f3 50%,#ededed 51%,#ffffff 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#ffffff',GradientType=0 ); /* IE6-9 */
}

.pricingtable th.bronze{
font: 16px Georgia, "Times New Roman", Times, serif;
font-weight: bolder;
color:#f2c9b9;
text-shadow:0 1px 1px #3f1200;ca866b
background: #f0b7a1; /* Old browsers */
background: -moz-linear-gradient(top, #f0b7a1 0%, #8c3310 50%, #752201 51%, #bf6e4e 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f0b7a1), color-stop(50%,#8c3310), color-stop(51%,#752201), color-stop(100%,#bf6e4e)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #f0b7a1 0%,#8c3310 50%,#752201 51%,#bf6e4e 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #f0b7a1 0%,#8c3310 50%,#752201 51%,#bf6e4e 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #f0b7a1 0%,#8c3310 50%,#752201 51%,#bf6e4e 100%); /* IE10+ */
background: linear-gradient(to bottom, #f0b7a1 0%,#8c3310 50%,#752201 51%,#bf6e4e 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f0b7a1', endColorstr='#bf6e4e',GradientType=0 ); /* IE6-9 */
border: 1px solid #1d1d1d;
-webkit-border-top-left-radius:10px;
-webkit-border-top-right-radius:10px;
-moz-border-radius:10px 10px 0px 0px;
border-top-left-radius:10px;
border-top-right-radius:10px;
}
.pricingtable th.silver{
font: 16px Georgia, "Times New Roman", Times, serif;
font-weight: bolder;
color:#fff;
text-shadow:0 1px 1px #727272;
background: #dedfe0; /* Old browsers */
background: -moz-linear-gradient(top, #dedfe0 0%, #b5b5b5 50%, #a5a5a5 52%, #d6d6d6 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#dedfe0), color-stop(50%,#b5b5b5), color-stop(52%,#a5a5a5), color-stop(100%,#d6d6d6)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #dedfe0 0%,#b5b5b5 50%,#a5a5a5 52%,#d6d6d6 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #dedfe0 0%,#b5b5b5 50%,#a5a5a5 52%,#d6d6d6 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #dedfe0 0%,#b5b5b5 50%,#a5a5a5 52%,#d6d6d6 100%); /* IE10+ */
background: linear-gradient(to bottom, #dedfe0 0%,#b5b5b5 50%,#a5a5a5 52%,#d6d6d6 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#dedfe0', endColorstr='#d6d6d6',GradientType=0 ); /* IE6-9 */
border: 1px solid #1d1d1d;
-webkit-border-top-left-radius:10px;
-webkit-border-top-right-radius:10px;
-moz-border-radius:10px 10px 0px 0px;
border-top-left-radius:10px;
border-top-right-radius:10px;
}
.pricingtable th.gold{
font: 16px Georgia, "Times New Roman", Times, serif;
font-weight: bolder;
color:#feecbe;
text-shadow:0 1px 1px #906700;
background: #f9da89; /* Old browsers */
background: -moz-linear-gradient(top, #f9da89 0%, #f9c43b 49%, #eaa800 51%, #f9ca52 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f9da89), color-stop(49%,#f9c43b), color-stop(51%,#eaa800), color-stop(100%,#f9ca52)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #f9da89 0%,#f9c43b 49%,#eaa800 51%,#f9ca52 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #f9da89 0%,#f9c43b 49%,#eaa800 51%,#f9ca52 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #f9da89 0%,#f9c43b 49%,#eaa800 51%,#f9ca52 100%); /* IE10+ */
background: linear-gradient(to bottom, #f9da89 0%,#f9c43b 49%,#eaa800 51%,#f9ca52 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f9da89', endColorstr='#f9ca52',GradientType=0 ); /* IE6-9 */
border: 1px solid #1d1d1d;
-webkit-border-top-left-radius:10px;
-webkit-border-top-right-radius:10px;
-moz-border-radius:10px 10px 0px 0px;
border-top-left-radius:10px;
border-top-right-radius:10px;
}
.pricingtable tfoot th{
background-color: #3b3b3b;
font:bold 16px Arial, Helvetica, sans-serif;
color: #fff;
text-align: center;
padding: 10px;
}
.pricingtable tfoot td{
background-color: #3b3b3b;
font:bold 20px Arial, Helvetica, sans-serif;
color: #fff;
text-align: center;
padding: 10px;
}
.pricingtable tbody span.tick{
position: relative;
float: left;
width: 16px;
height: 16px;
margin-left: -8px;
margin-bottom: -3px;
left: 50%;
background: url('tick.png') no-repeat center center;
}
.pricingtable tbody span.cross{
position: relative;
float: left;
width: 16px;
height: 16px;
margin-left: -8px;
margin-bottom: -3px;
left: 50%;
background: url('cross.png') no-repeat center center;
}

If you want to change the width of the table simply edit width: 100%; within thetable.pricingtable element at the top of the CSS. You can use percentages or pixels, whatever suits.

…and that is pretty much it, there isn’t much more to explain as it is purely CSS and HTML.
You can see a LIVE PREVIEW here.

If you have any problems implementing this table, then please don’t hesitate to comment below and myself or someone else will be happy to assist you!

Thank you!

Comments

Popular posts from this blog

75 Surprisingly Creative Facebook Timeline Covers

Now that you have shifted to “Facebook Timeline” to display you profile in a better way, get creative with it. Facebook timeline gives you a chance to turn you profile exclusive and innovative. Putting up a personal picture as cover, will only make you look outdated. You can try some exciting covers to design your very own Facebook profile in distinguished style. We have scrounged through web to pick 75 amazing Facebook Timeline covers for this list. Unique cover pictures can give your timeline a different-from-the-rest look. You can create your own creative covers picking ideas from these cool pictures listed below. If you like this article, you might be interested in some of our other articles on  Facebook Scripts, Best Facebook Apps, Best Facebook Games, and Facebook Tips You Should Check . Ekkapong Techawongthaworn Be a brand ambassador and flaunt your fanaticism for gadgets and shopping on your cover. Ekkapong Techawongthaworn Gabriel Fort A snapshot of an Apple iPad interface.

30 Free Facebook Timeline Cover Backgrounds

If you really want a good cover for your Facebook Timeline, you have landed on the right page. It’s seen that people have faced problem in finding covers of their choice because of the specific size issue. However, you do not need to look further, as this list presents 30 cool free Facebook Timeline covers for you to sport them on your profile page. The list includes creative, funny, exciting and cool pictures of perfect dimensions to fit your Facebook cover without having you to crop or resize them. Moreover, they are absolutely free to download, so you can instantly put them on your Timeline cover to express numerous moods and inspirations. If you like this article, you might be interested in some of our other articles on  Thumbs Up Symbol,Heart Symbol On Facebook, Facebook Timeline Covers and Facebook Timeline As Used By Brands . Love Calculator What all it takes to result in love? A pretty woman and drinks. Love Calculator This Guy Rocks Let your cover boast about you and tell your

PHP File Upload

With PHP, it is possible to upload files to the server. Create an Upload-File Form To allow users to upload files from a form can be very useful. Look at the following HTML form for uploading files: <html> <body> <form action="upload_file.php" method="post" enctype="multipart/form-data"> <label for="file">Filename:</label> <input type="file" name="file" id="file" /> <br /> <input type="submit" name="submit" value="Submit" /> </form> </body> </html> Notice the following about the HTML form above: The enctype attribute of the <form> tag specifies which content-type to use when submitting the form. "multipart/form-data" is used when a form requires binary data, like the contents of a file, to be uploaded The type="file" attribute of the <input> tag specifies that the input sho