Learn web development 05 - All About Tables in HTML and HTML Divs, Spans, Headers, Footers, Navs.
Tags: html, webdev, beginners, css
Published: 2021-07-30 11:46:13

Hello, Welcome. My name is kunaal. This is a part of learn web development series.

In today's article, you'll learn about tables in HTML and also learn about html Divs, Spans, Headers, Footers, Navs.

Today's article is the last article on web development HTML Series. From tomorrow we'll learn about CSS.

#Tables

We all know what table is and what the purpose of table is. So, lets see how can we make table in in our webpage.

###Table tag
`<table></table>`
Table tag is used to create table in the page. 

```HTML
<table>
</table>
```
Output - 
Well, we'll not see anything because our table is empty.

So we know table consists of two things rows and column, right?
So once we have made our table, then we need to create rows and columns.

###tr tag
`<tr></tr>`
This is knows as table row tag. And yes, this is used to create rows inside table.

```HTML
<table>
    <tr>
        
    </tr>
</table>
```

###td tag
`<td></td>`
This is known as table data. This is used to create data inside rows. You can create any number of data inside rows. Each data represent single column.

```HTML
table>
    <tr>
        <td>data 1</td>
        <td>data 2</td>
        <td>data 3</td>
        <td>data 4</td>
    </tr>
</table>
```
Now, as we added data inside our table. We can see output.
######Output
![Capture-2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ab3qcb9gycq3rkg110hi.PNG)
It doesn't look like a table. Does it ?

To make this look like table use `border` attribute in `table` tag.
```HTML
<table border>
    <tr>
        <td>data 1</td>
        <td>data 2</td>
        <td>data 3</td>
        <td>data 4</td>
    </tr>
</table>
``` 
######Output
![Capture-3](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m3j5mejfr8keeh7i4lzs.PNG)

So that's how we create table in the page.

#Divs, Headers, Footers, Spans, Navs

###Div
`<div></div>`

This tag defines a division or a section in an HTML document. You can put anything inside this element images, text, forms anything. This is used as a wrapper for other element.

```HTML
<div>
  <h2>This is a heading.</h2>
</div>

<div>
  <img src="image.png" alt="image inside div">
</div>
```

###Header
`<header></header>`

This tag is same as `<div></div>`. The only difference is that we use `<header></header>` for creating header section. You can use this tag in place of `div` but generally this tag purpose is to create wrapper for header section.

```HTML
<header>
  <h1>Welcome, to home page</h1>
  <p>This is a paragraph inside a header element</p>
</header>
```
###Footer
`<footer></footer>`

This is also the same as `<div>`. But, it generally use to wrap footer elements or to create a footer in the page.

```HTML
<footer>
  <a href="/">logo</a>
  <ul>
    <li>Home</li>
    <li>Project</li>
    <li>About</li>
    <li>Contact</li>
  </ul>
</footer>
```
>`<nav>` tag is also same as div. It is used to create navbar for the page.

###Span
`<span></span>`
This is used to mark a part of a document or part of a text.
Span tag is like `div` but the difference is `span` tag is used to create inline element whereas `div` is used to create `block` element. Example

![graphic](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/foiz7mo1o745fg81aaza.png) 

```HTML
<p>This is a text with<span> span </span>tag in it.</p>
```
So, that's sit about Tables and divs. I hope you understood each and everything. If you have any doubt feel free to ask me in comments.

If you like, you can subscribe my [youtube channel](https://www.youtube.com/c/modern_web?sub_confirmation=1).I create awesome web development tutorials. You can also watch tutorial on [Youtube Clone](https://www.youtube.com/watch?v=fOKgHld96mU)

Thanks For reading.