How to define the number of columns a cell should span using HTML5 ? Last Updated : 28 Oct, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report This article will show you how a column can be made to span over multiple cells. This is done using the colspan attribute when using the <td> tag. This allows the single table cell to span the width of more than one cell or column. It provides similar functionality to the “merge cell” functions in spreadsheet programs like Excel. Syntax: <td colspan = "value">table content...</td> Example: html <!DOCTYPE html> <html> <head> <style> body { text-align: center; } h1 { color: green; } table, tbody, td { border: 1px solid black; border-collapse: collapse; } </style> </head> <body> <h1>GeeksforGeeks</h1> <h2> How to define the number of columns a cell should span using HTML5? </h2> <table> <!-- The <tr> tag starts here --> <tr> <th>Name</th> <th>User ID</th> </tr> <tr> <td>Anmol</td> <td>345</td> </tr> <tr> <td>Priya</td> <td>567</td> </tr> <!-- The last row --> <tr> <!-- This td will span two columns, that is a single column will take up the space of 2 --> <td colspan="2"> Sumit: 6574 </td> </tr> </table> </body> </html> Output: Supported Browsers: Google ChromeInternet ExplorerFirefoxOperaSafari Comment More infoAdvertise with us Next Article How to set the number of rows a table cell should span in HTML ? M manaschhabra2 Follow Improve Article Tags : Web Technologies HTML HTML5 HTML-Questions Similar Reads How to set the number of rows a table cell should span in HTML ? In this article, we will show how multiple rows are spanned by a table header cell. The task can be done by using the rowspan attribute while using the <th> tag. This property is used to merge one or more cells as well as increase the height of the single header cell automatically. Syntax: 2 min read How to Define a Minimum Width for HTML Table Cell using CSS ? To set a minimum width for an HTML table cell using CSS, apply the min-width property directly to the <td> element, ensuring it does not shrink below the specified size. This ensures a minimum width for the cell content, maintaining layout integrity. Table of Content Using the min-width Proper 2 min read How to Set the Fixed Width of a Span Element in CSS ? Setting a fixed width of a span element is useful when we need to control the size of a specific inline element. The span element is mostly used in styling specific parts of text and other inline elements. There are various approaches to setting a fixed width of a span element in CSS including, widt 4 min read How to set the table cell widths to minimum except last column using CSS ? Tables are widely used for showing the data and sometimes we get into a scenario where we need some special kind of styling over the rows or the cells. We will explore one case where we must make the last column dynamic using CSS and the rest taking the required width.These are the following approac 3 min read How to create table cell using HTML5 ? In this article, we will create cell in a table by using a combination of <tr> and <td> tag in a HTML table. Syntax: <table> <tr> <td> . . . </td> <td> . . . </td> </tr> </table> Example: html <!DOCTYPE html> <html> <head> 1 min read How to arrange text in multi columns using CSS3 ? In many websites, content is often displayed in parallel stacks to present more information in a compact space, similar to how newspapers and books are formatted. This pattern helps display large amounts of content in a small area, making it easier to read. In this article, we will learn how to arra 4 min read Like