WDS11 - HTML Tables

blackbird

Omkar Ajnadkar

Posted on December 16, 2017

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: <table> : HTML table is defined with this tag. <tr> : Each table row is defined with this tag. <th** >** : This is used for representing table headers. <td> : 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 <table> tag with the value equal to any integer inside quotes. You can also add the width attribute to <table> tag in percentage. You can also align particular text with align attribute. There is one more tag called <caption> which is used to give the table a name or heading which will be displayed on the table. It will be used inside <table> tag.  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.

💖 💪 🙅 🚩
blackbird
Omkar Ajnadkar

Posted on December 16, 2017

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

WDS15 - Handle your Metadata
html WDS15 - Handle your Metadata

December 21, 2017

WDS14 - Webpage Inside Webpage
html WDS14 - Webpage Inside Webpage

December 19, 2017

WDS11 - HTML Tables
html WDS11 - HTML Tables

December 16, 2017

WDS10 - More About HTML Images
html WDS10 - More About HTML Images

December 15, 2017

WDS9 - More about HTML Links
html WDS9 - More about HTML Links

December 14, 2017