{"id":799,"date":"2021-12-05T17:08:00","date_gmt":"2021-12-05T17:08:00","guid":{"rendered":"https:\/\/swatilathia.wordpress.com\/?page_id=799"},"modified":"2025-10-05T05:20:36","modified_gmt":"2025-10-05T05:20:36","slug":"html-tags","status":"publish","type":"page","link":"https:\/\/swatilathia.com\/?page_id=799","title":{"rendered":"HTML  Tutorial 2 : Table &#038; Frame Tags"},"content":{"rendered":"<body>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-69dd89255ce0b\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-69dd89255ce0b\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/swatilathia.com\/?page_id=799\/#tag\" >&lt;Table&gt; tag<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/swatilathia.com\/?page_id=799\/#Attributes_of\" >Attributes of &lt;table&gt;<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/swatilathia.com\/?page_id=799\/#_tags\" >&lt;td&gt; &amp; &lt;th&gt; tags<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\" id=\"table-tag\"><span class=\"ez-toc-section\" id=\"tag\"><\/span><strong>&lt;Table&gt; tag<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list has-medium-font-size\">\n<li>HTML table tag is used to display data in tabular form (row * column). <\/li>\n\n\n\n<li>There can be many columns in a row.<\/li>\n\n\n\n<li>&lt;table&gt; tag makes use of &lt;tr&gt; , &lt;td&gt;, and &lt;th&gt; elements to create a table.<\/li>\n\n\n\n<li>In Each table, table row is defined by &lt;tr&gt; tag, table header is defined by &lt;th&gt;, and table data is defined by &lt;td&gt; tags.<\/li>\n<\/ul>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code has-medium-font-size\"><code>&lt;table border&gt;\u00a0\n&lt;tr&gt;\n&lt;th&gt;First Name&lt;\/th&gt;\n&lt;th&gt;Last Name&lt;\/th&gt;\n&lt;th&gt;State&lt;\/th&gt;\n&lt;\/tr&gt;\u00a0\n&lt;tr&gt;\n&lt;td&gt;Mary&lt;\/td&gt;\n&lt;td&gt;Kom&lt;\/td&gt;\n&lt;td&gt;Manipur&lt;\/td&gt;\n&lt;\/tr&gt;\u00a0\n&lt;tr&gt;\n&lt;td&gt;Neeraj&lt;\/td&gt;\n&lt;td&gt;Chopra&lt;\/td&gt;\n&lt;td&gt;Hariyana&lt;\/td&gt;\n&lt;\/tr&gt;\u00a0\n&lt;tr&gt;\n&lt;td&gt;PV&lt;\/td&gt;\n&lt;td&gt;Sindhu&lt;\/td&gt;\n&lt;td&gt;Kerala&lt;\/td&gt;\n&lt;\/tr&gt;\u00a0\n&lt;tr&gt;\n&lt;td&gt;Mirabai&lt;\/td&gt;\n&lt;td&gt;Chanu&lt;\/td&gt;\n&lt;td&gt;Manipur&lt;\/td&gt;\n&lt;\/tr&gt;\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\n&lt;\/table&gt;<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li class=\"has-medium-font-size\">The above table contains 5 rows &amp; 3 columns = 15 values<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list has-medium-font-size\">\n<li class=\"has-medium-font-size\"><strong>Result<\/strong><\/li>\n<\/ul>\n\n\n\n<table border>\u00a0\n<tr>\n<th>First Name<\/th>\n<th>Last Name<\/th>\n<th>State<\/th>\n<\/tr>\u00a0\n<tr>\n<td>Mary<\/td>\n<td>Kom<\/td>\n<td>Manipur<\/td>\n<\/tr>\u00a0\n<tr>\n<td>Neeraj<\/td>\n<td>Chopra<\/td>\n<td>Hariyana<\/td>\n<\/tr>\u00a0\n<tr>\n<td>PV<\/td>\n<td>Sindhu<\/td>\n<td>Kerala<\/td>\n<\/tr>\u00a0\n<tr>\n<td>Mirabai<\/td>\n<td>Chanu<\/td>\n<td>Manipur<\/td>\n<\/tr>\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\n<\/table>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"attributes-of-table\"><span class=\"ez-toc-section\" id=\"Attributes_of\"><\/span><strong>Attributes of &lt;table&gt;<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list has-medium-font-size\">\n<li><strong>border: <\/strong>It specifies the border of HTML table. E.g. &lt;table Border=\u201d2\u201d&gt;<\/li>\n\n\n\n<li><strong>align:<\/strong> It specifies the visual alignment of table. It can be right, left, center, justify, char.<\/li>\n\n\n\n<li>E.g. &lt;table align=\u201dcenter\u201d&gt;<\/li>\n\n\n\n<li><strong>bgcolor:<\/strong> It specifies the background color of the table. E.g. &lt;table bgcolor=\u201dcyan\u201d&gt;<\/li>\n\n\n\n<li><strong>background<\/strong>: It specifies the background color of table or just for one cell.<\/li>\n\n\n\n<li>E.g. : &lt;table background=\u201dtest.png\u201d&gt;<\/li>\n\n\n\n<li><strong>width: <\/strong>It specifies the width of the table in pixels of %<\/li>\n\n\n\n<li><strong>height: <\/strong>It specifies the height of the table in pixels of %<\/li>\n\n\n\n<li><strong>bordercolor: <\/strong>It specifies the border color of entire table. You can use a proper colorname or rgb format or hexcode. E.g. &lt;table border=\u201d10\u201d bordercolor=\u201dred\u201d&gt;.<\/li>\n\n\n\n<li><strong><em>If you don\u2019t specify the border property, you don\u2019t get bordercolor.<\/em><\/strong><\/li>\n\n\n\n<li><strong>bordercolorlight: <\/strong>It shows the border color of table in 3D like effect, where the color appears on the left &amp; top side of the table.<\/li>\n\n\n\n<li><strong><em>It only appears in Internet Explorer.<\/em><\/strong><\/li>\n\n\n\n<li>E.g. &lt;table border=10 bordercolorlight=\u201dred\u201d&gt;\u00a0<\/li>\n\n\n\n<li><strong>bordercolordark: <\/strong>It shows the border color of table in 3D like effect, where the color appears on the left &amp; top side of the table.<\/li>\n\n\n\n<li><strong><em>It only appears in Internet Explorer.<\/em><\/strong><\/li>\n\n\n\n<li>E.g. &lt;table border=10 bordercolordark=\u201dred\u201d&gt;\u00a0<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"td-th-tags\"><span class=\"ez-toc-section\" id=\"_tags\"><\/span><strong>&lt;td&gt; &amp; &lt;th&gt; tags<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list has-medium-font-size\">\n<li>An HTML table has two kinds of cells:\n<ul class=\"wp-block-list\">\n<li>Header cells \u2013 contains header information (created with the &lt;th&gt; element)<\/li>\n\n\n\n<li>Data cells \u2013 contains data (created with the &lt;td&gt; element)<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>The text in &lt;td&gt; elements is regular and left-aligned by default.<\/li>\n\n\n\n<li class=\"has-medium-font-size\">The text in &lt;th&gt; elements are bold and centered by default.<\/li>\n\n\n\n<li><strong>cellspacing: <\/strong>It specifies the space between cells.<\/li>\n\n\n\n<li><strong>cellpadding: <\/strong>It specifies the space between the cell borders and their contents.<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code has-medium-font-size\"><code>&lt;html&gt;\n\u00a0\u00a0 &lt;head&gt;\n\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;title&gt;HTML Table Cellpadding&lt;\/title&gt;\n\u00a0\u00a0 &lt;\/head&gt;\n\u00a0\u00a0 &lt;body&gt;\n\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;table border = \"3\" bordercolor=darkgray bgcolor=beige cellpadding = \"10\" cellspacing = \"15\"&gt;\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;tr&gt;\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;th&gt;Name&lt;\/th&gt;\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;th&gt;City&lt;\/th&gt;\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;\/tr&gt;\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;tr&gt;\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;td&gt;Dhyan Chand&lt;\/td&gt;\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;td&gt;Prayagraj&lt;\/td&gt;\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;\/tr&gt;\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;tr&gt;\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;td&gt;Milkha Singh&lt;\/td&gt;\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;td&gt;Chandigrah&lt;\/td&gt;\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;\/tr&gt;\n\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;\/table&gt;\n\u00a0\u00a0 &lt;\/body&gt;\n&lt;\/html&gt;<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li class=\"has-medium-font-size\"><strong>Result<\/strong><\/li>\n<\/ul>\n\n\n\n<table border=\"3\" bordercolor=\"darkgray\" bgcolor=\"beige\" cellpadding=\"10\" cellspacing=\"15\">\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <tr>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <th>Name<\/th>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <th>City<\/th>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/tr>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <tr>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <td>Dhyan Chand<\/td>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <td>Prayagraj<\/td>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/tr>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <tr>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <td>Milkha Singh<\/td>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <td>Chandigrah<\/td>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/tr>\n\u00a0\u00a0\u00a0\u00a0\u00a0 <\/table>\n\u00a0\u00a0 <\/body>","protected":false},"excerpt":{"rendered":"<p>&lt;Table&gt; tag Example: \u00a0 First Name Last Name State \u00a0 Mary Kom Manipur \u00a0 Neeraj Chopra Hariyana \u00a0 PV Sindhu Kerala \u00a0 Mirabai Chanu Manipur \u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Attributes of &lt;table&gt; &lt;td&gt; &amp; &lt;th&gt; tags \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Name \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 City \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Dhyan Chand \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Prayagraj \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Milkha Singh \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Chandigrah \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"zakra_page_container_layout":"customizer","zakra_page_sidebar_layout":"customizer","zakra_remove_content_margin":false,"zakra_sidebar":"customizer","zakra_transparent_header":"customizer","zakra_logo":0,"zakra_main_header_style":"default","zakra_menu_item_color":"","zakra_menu_item_hover_color":"","zakra_menu_item_active_color":"","zakra_menu_active_style":"","zakra_page_header":true,"om_disable_all_campaigns":false,"footnotes":""},"class_list":["post-799","page","type-page","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/swatilathia.com\/index.php?rest_route=\/wp\/v2\/pages\/799","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/swatilathia.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/swatilathia.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/swatilathia.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/swatilathia.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=799"}],"version-history":[{"count":5,"href":"https:\/\/swatilathia.com\/index.php?rest_route=\/wp\/v2\/pages\/799\/revisions"}],"predecessor-version":[{"id":6108,"href":"https:\/\/swatilathia.com\/index.php?rest_route=\/wp\/v2\/pages\/799\/revisions\/6108"}],"wp:attachment":[{"href":"https:\/\/swatilathia.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=799"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}