
how to create a HTML & CSS Table
Before We Start
Every developers need, clean and modern elements to develop their websites, It contain pictures and a user interface element within a website. The most important one and the first section that the user sees when he/she enters a website. how to create a HTML & CSS Table
So if you are a person who wishes to develop a website, you have to know how to create that properly.

how to create a HTML & CSS Table
Download Udemy paid courses FREE
We are here to solve your problem. In this article we discuss how to create this elements. Before we start please read the below articles which easier you to understand the process, if you are new to development.
Step 1 – Add HTML
It’s too easy and simple. Just copy and paste below code in your HTML editor between <body> </body> tag.
<div class="aa_htmlTable">
<h2 class="aa_h2">HTML Table</h2>
<table>
<thead>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
</thead>
<tbody>
<tr>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>February</td>
<td>$80</td>
</tr>
</tbody>
<tfoot>
<tr>
<td>Sum</td>
<td>$180</td>
</tr>
</tfoot>
</table>
</div>
<div class="aa_css">
<h2 class="aa_h2">CSS Table</h2>
<div class="table">
<div class="thead">
<div class="tr">
<div class="th">.table > .thead > .tr > .th</div>
<div class="th">.table > .thead > .tr > .th</div>
</div>
</div>
<div class="tbody">
<div class="tr">
<div class="td">
.table > .tbody > .tr > .td
</div>
<div class="td">
.table > .tbody > .tr > .td
</div>
</div>
<div class="tr">
<div class="td">
.table > .tbody > .tr > .td
</div>
<div class="td">
.table > .tbody > .tr > .td
</div>
</div>
</div>
<div class="tfoot">
<div class="tr">
<div class="td">
.table > .tfoot > .tr > .td
</div>
<div class="td">
.table > .tfoot > .tr > .td
</div>
</div>
</div>
</div>
<div class="aa_ahmadawais">
Developed by <a href="http://AhmadAwais.com/about">Ahmad Awais</a> - Open Source Engineer & Dev Advocate
</div>
</div>
Step 2 – Add CSS
Download Udemy paid courses FREE
Copy and paste below code in your HTML editor between <style></style> tag.
<style>
body {
display: table;
width: 100%;
background: #dedede;
text-align: center;
}
* {
/* Safari/Chrome, other WebKit */
/* Firefox, other Gecko */
box-sizing: border-box;
/* Opera/IE 8+ */
}
.aa_h2 {
font: 100 5rem/1 Roboto;
text-transform: uppercase;
}
table {
background: #fff;
}
table, thead, tbody, tfoot, tr, td, th {
text-align: center;
margin: auto;
border: 1px solid #dedede;
padding: 1rem;
width: 50%;
}
.table {
display: table;
width: 50%;
}
.tr {
display: table-row;
}
.thead {
display: table-header-group;
}
.tbody {
display: table-row-group;
}
.tfoot {
display: table-footer-group;
}
.col {
display: table-column;
}
.colgroup {
display: table-column-group;
}
.td, .th {
display: table-cell;
width: 50%;
}
.caption {
display: table-caption;
}
.table,
.thead,
.tbody,
.tfoot,
.tr,
.td,
.th {
text-align: center;
margin: auto;
padding: 1rem;
}
.table {
background: #fff;
margin: auto;
border: none;
padding: 0;
margin-bottom: 5rem;
}
.th {
font-weight: 700;
border: 1px solid #dedede;
}
.th:nth-child(odd) {
border-right: none;
}
.td {
font-weight: 300;
border: 1px solid #dedede;
border-top: none;
}
.td:nth-child(odd) {
border-right: none;
}
.aa_htmlTable {
background: tomato;
padding: 5rem;
display: table;
width: 100%;
height: 100vh;
vertical-align: middle;
}
.aa_css {
background: skyblue;
padding: 5rem;
display: table;
width: 100%;
height: 100vh;
vertical-align: middle;
}
.aa_ahmadawais {
display: table;
width: 100%;
font: 100 1.2rem/2 Roboto;
margin: 5rem auto;
}
</style>
At the end we will have something like this. You can change fonts, colors, backgrounds and all things that you want.Enjoy it.

Video Tutorial
Please watch this video to better understand this tutorial and don’t forget to subscribe to our channel.
Download Udemy paid courses FREE
Help others to find out about this article on Social Media sites. If you have any doubt or any problem, don’t hesitate to contact us. Thereafter we will be able to help you and also make sure you bookmark our site on your browser.