TablesTutorials

how to create a simple html table

how to create a simple html table

how to create a simple html 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 simple html 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 simple html 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.

<html>

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Employee Information</title>
  <link rel="stylesheet" href="css/normalize.css">
  <link href='https://fonts.googleapis.com/css?family=Nunito:400,300' rel='stylesheet' type='text/css'>
  <link rel="stylesheet" href="css/main.css">
</head>

<body>

  <table>
    <caption>Employee Information</caption>
    <thead>
      <tr>
        <th scope="col">Name</th>
        <th scope="col">E-mail</th>
        <th scope="col">Job role</th>
      </tr>
    </thead>
    <tfoot>
      <tr>
        <td colspan="3">Data is updated every 15 minutes.</td>
      </tr>
    </tfoot>
    <tbody>
      <tr>
        <th scope="row">Nick Pettit</th>
        <td>nick@example.com</td>
        <td>Web Designer</td>
      </tr>
      <tr>
        <th scope="row">Andrew Chalkley</th>
        <td>andrew@example.com</td>
        <td>Front-End Developer</td>
      </tr>
      <tr>
        <th scope="row">Dave McFarland</th>
        <td>dave@example.com</td>
        <td>Front-End Developer</td>
      </tr>
      <tr>
        <th scope="row">Guil Hernandez</th>
        <td>guil@example.com</td>
        <td>Web Designer</td>
      </tr>
    </tbody>
  </table>

</body>

</html>

Step 2 – Add CSS

Download Udemy paid courses FREE

Copy and paste below code in your HTML editor between <style></style> tag.

<style>
*,
*:before,
*:after {
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

body {
  font-family: "Nunito", sans-serif;
  color: #384047;
}

table {
  max-width: 960px;
  margin: 10px auto;
}

caption {
  font-size: 1.6em;
  font-weight: 400;
  padding: 10px 0;
}

thead th {
  font-weight: 400;
  background: #8a97a0;
  color: #fff;
}

tr {
  background: #f4f7f8;
  border-bottom: 1px solid #fff;
  margin-bottom: 5px;
}

tr:nth-child(even) {
  background: #e8eeef;
}

th,
td {
  text-align: left;
  padding: 20px;
  font-weight: 300;
}

tfoot tr {
  background: none;
}

tfoot td {
  padding: 10px 2px;
  font-size: 0.8em;
  font-style: italic;
  color: #8a97a0;
}

</style>

At the end we will have something like this. You can change fonts, colors, backgrounds and all things that you want. Enjoy it.

how to create a simple html table

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.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button