{"id":9363,"date":"2022-10-06T05:07:56","date_gmt":"2022-10-06T05:07:56","guid":{"rendered":"https:\/\/mdr.foobrdigital.com\/?p=9363"},"modified":"2022-10-06T05:07:56","modified_gmt":"2022-10-06T05:07:56","slug":"html-colspan-attribute","status":"publish","type":"post","link":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/2022\/10\/06\/html-colspan-attribute\/","title":{"rendered":"HTML colspan Attribute"},"content":{"rendered":"\n<p>The HTML&nbsp;colspan&nbsp;attribute specifies how many columns a table cell should span. This attribute allows a single table cell to span the width of more than one column or cell. It has the same functionality as \u201cmerge cell\u201d in Excel.<\/p>\n\n\n\n<p>You can use the\u00a0colspan\u00a0attribute on the\u00a0&lt;td>\u00a0and\u00a0&lt;th>\u00a0elements.<\/p>\n\n\n\n<p>When the&nbsp;colspan&nbsp;attribute is used on the &lt;td&gt; tag, it determines the number of standard cells it should span. When used on the &lt;th&gt; tag, the&nbsp;colspan&nbsp;attribute specifies the number of header cells it should span.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"syntax-2\">Syntax<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;tag colspan=\"value\"&gt;&lt;\/tag&gt;<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"example-of-the-html-span-class-attribute-colspan-span-pan-attribute-used-on-the-lt-td-gt-element-4\">Example of the HTML&nbsp;colspan&nbsp;pan attribute used on the &lt;td&gt; element:<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n  &lt;head&gt;\n    &lt;title&gt;Title of the document&lt;\/title&gt;\n  &lt;\/head&gt;\n  &lt;body&gt;\n    &lt;table border=\"1\"&gt;\n      &lt;tr&gt;\n        &lt;th&gt;Month&lt;\/th&gt;\n        &lt;th&gt;Salary&lt;\/th&gt;\n      &lt;\/tr&gt;\n      &lt;tr&gt;\n        &lt;td&gt;March&lt;\/td&gt;\n        &lt;td&gt;$100&lt;\/td&gt;\n      &lt;\/tr&gt;\n      &lt;tr&gt;\n        &lt;td&gt;April&lt;\/td&gt;\n        &lt;td&gt;$150&lt;\/td&gt;\n      &lt;\/tr&gt;\n      &lt;tr&gt;\n        &lt;td colspan=\"2\"&gt;Total: $250&lt;\/td&gt;\n      &lt;\/tr&gt;\n    &lt;\/table&gt;\n  &lt;\/body&gt;\n&lt;\/html&gt;<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"example-of-the-html-span-class-attribute-colspan-span-attribute-used-on-the-lt-th-gt-element-6\">Example of the HTML&nbsp;colspan&nbsp;attribute used on the &lt;th&gt; element:<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n  &lt;head&gt;\n    &lt;title&gt;Title of the document&lt;\/title&gt;\n  &lt;\/head&gt;\n  &lt;body&gt;\n    &lt;table border=\"1\"&gt;\n      &lt;tr&gt;\n        &lt;th colspan=\"2\"&gt;Month and Date&lt;\/th&gt;\n      &lt;\/tr&gt;\n      &lt;tr&gt;\n        &lt;td&gt;January&lt;\/td&gt;\n        &lt;td&gt;15&lt;\/td&gt;\n      &lt;\/tr&gt;\n      &lt;tr&gt;\n        &lt;td&gt;February&lt;\/td&gt;\n        &lt;td&gt;23&lt;\/td&gt;\n      &lt;\/tr&gt;\n    &lt;\/table&gt;\n  &lt;\/body&gt;\n&lt;\/html&gt;<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>The HTML&nbsp;colspan&nbsp;attribute specifies how many columns a table cell should span. This attribute allows a single table cell to span the width of more than one column or cell. It has the same functionality as \u201cmerge cell\u201d in Excel. You can use the\u00a0colspan\u00a0attribute on the\u00a0&lt;td>\u00a0and\u00a0&lt;th>\u00a0elements. When the&nbsp;colspan&nbsp;attribute is used on the &lt;td&gt; tag, it determines [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[327],"tags":[],"_links":{"self":[{"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/posts\/9363"}],"collection":[{"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/comments?post=9363"}],"version-history":[{"count":0,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/posts\/9363\/revisions"}],"wp:attachment":[{"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/media?parent=9363"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/categories?post=9363"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/tags?post=9363"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}