
- HTML - Home
- HTML - Roadmap
- HTML - Introduction
- HTML - History & Evolution
- HTML - Editors
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Headings
- HTML - Paragraphs
- HTML - Fonts
- HTML - Blocks
- HTML - Style Sheet
- HTML - Formatting
- HTML - Quotations
- HTML - Comments
- HTML - Colors
- HTML - Images
- HTML - Image Map
- HTML - Frames
- HTML - Iframes
- HTML - Phrase Elements
- HTML - Code Elements
- HTML - Meta Tags
- HTML - Classes
- HTML - IDs
- HTML - Backgrounds
- HTML Tables
- HTML - Tables
- HTML - Table Headers & Captions
- HTML - Table Styling
- HTML - Table Colgroup
- HTML - Nested Tables
- HTML Lists
- HTML - Lists
- HTML - Unordered Lists
- HTML - Ordered Lists
- HTML - Definition Lists
- HTML Links
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML Color Names & Values
- HTML - Color Names
- HTML - RGB & RGBA Colors
- HTML - HEX Colors
- HTML - HSL & HSLA Colors
- HTML - HSL Color Picker
- HTML Forms
- HTML - Forms
- HTML - Form Attributes
- HTML - Form Control
- HTML - Input Attributes
- HTML Media
- HTML - Video Element
- HTML - Audio Element
- HTML - Embed Multimedia
- HTML Header
- HTML - Head Element
- HTML - Adding Favicon
- HTML - Javascript
- HTML Layouts
- HTML - Layouts
- HTML - Layout Elements
- HTML - Layout using CSS
- HTML - Responsiveness
- HTML - Symbols
- HTML - Emojis
- HTML - Style Guide
- HTML Graphics
- HTML - SVG
- HTML - Canvas
- HTML APIs
- HTML - Geolocation API
- HTML - Drag & Drop API
- HTML - Web Workers API
- HTML - WebSocket
- HTML - Web Storage
- HTML - Server Sent Events
- HTML Miscellaneous
- HTML - Document Object Model (DOM)
- HTML - MathML
- HTML - Microdata
- HTML - IndexedDB
- HTML - Web Messaging
- HTML - Web CORS
- HTML - Web RTC
- HTML Demo
- HTML - Audio Player
- HTML - Video Player
- HTML - Web slide Desk
- HTML Tools
- HTML - Velocity Draw
- HTML - QR Code
- HTML - Modernizer
- HTML - Validation
- HTML - Color Picker
- HTML References
- HTML - Cheat Sheet
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Character Entities
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
- HTML Resources
- HTML - Quick Guide
- HTML - Useful Resources
- HTML - Color Code Builder
- HTML - Online Editor
HTML - rowspan Attribute
HTML rowspan attribute specifies the number of rows spanned by a cell or grid cell within a table or grid.
If a row spans two rows, it represents it will take up two rows in that table. It is similar to the merge cell in a spreadsheet program such as Excel. And it allows a single table cell to span the height of many cells or rows.
Syntax
<th|td rowspan="2 | 3 | 4, " >
Applies on
Below-listed element allows the use of the HTML rowspan attribute.
Element | Description |
---|---|
<th> | HTML <th> tag designates the header cell for HTML tables. |
<td> | HTML <td> tag designates the data cell for HTML tables. |
Examples of HTML rowspan attribute
Below examples will illustrate the HTML rowspan attribute, where and how we should use this attribute!
Using rowspan attribute to merge table header cells
The output window displays a table by merging the three row table cells of first column.
<!DOCTYPE html> <html> <head> <title>The td rowspan attribute</title> <style> table, th, td { border: 1px solid black; } </style> </head> <body> <h1>The th rowspan attribute</h1> <table> <tr> <th rowspan="3">tutorialspoint</th> <th>Employee</th> <th>Designation</th> </tr> <tr> <td>Aman Kumar</td> <td>technical content writer</td> </tr> <tr> <td>Vivek Kumar</td> <td>Developer</td> </tr> </table> </body> </html>
Using rowspan attribute to merge table data cells
The output window displays a table by merging the second and third row table cells of last column.
<!DOCTYPE html> <html> <head> <title>The td rowspan attribute</title> <style> table, th, td { border: 1px solid black; } </style> </head> <body> <h1>The td rowspan attribute</h1> <table> <tr> <th>Company</th> <th>Location</th> <th>Founder</th> </tr> <tr> <td>tutorialspoint</td> <td>hyderabad</td> <td rowspan="2">MD.Mohtashim</td> </tr> <tr> <td>tutorix</td> <td>Noida</td> </tr> </table> </body> </html>
Supported Browsers
Attribute | ![]() |
![]() |
![]() |
![]() |
![]() |
---|---|---|---|---|---|
rowspan | Yes | Yes | Yes | Yes | Yes |
html_attributes_reference.htm
Advertisements