Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

WDS11 - HTML Tables

In the last article we learned about:
  • Floating images in HTML
  • How to create Image mapping in HTML
In this article, we will start our discussion about tables in HTML. Tables are the great way to represent your information in tabular form. Following tags are used to create the table:
: HTML table is defined with this tag.
: Each table row is defined with this tag.
> : This is used for representing table headers.
: This tag is used for defining table data.
By default Html Tables will not add any borders inside or outside of tables. To add borders use the border attribute inside tag with the value equal to any integer inside quotes. You can also add the width attribute to
tag in percentage. You can also align particular text with align attribute.
There is one more tag called
which is used to give the table a name or heading which will be displayed on the table. It will be used inside
Let's see the example to understand this concept completely:

There may be the case when the particular cell should span normal one column. In such case, you will use attribute colspan in that cell. The value of attribute colspan will be the number of columns we want that span to that cell.

Similarly, there is rowspan attribute that is used to spread the span in multiple rows with its value equal to the number of rows we want to spread the span. 

For any text you can always use attributes like align, color, background and formatting like bold, etalic or underline to customise your table. We can customise our table much more with CSS but we will do it when we will learn CSS.
That's all for today. Practice tables with various attributes and types to master in it. In the next part, we will learn about HTML lists and their types. Comment on how you think this article is, what improvements should I do and for any doubts. Share with your friends and keep coding.

This post first appeared on The Coding Express, please read the originial post: here

Share the post

WDS11 - HTML Tables


Subscribe to The Coding Express

Get updates delivered right to your inbox!

Thank you for your subscription