HTML | Rowspan Attribute - GeeksforGeeks
Có thể bạn quan tâm
- Tutorials
- Python Tutorial
- Taking Input in Python
- Python Operators
- Python Data Types
- Python Numbers
- Python String
- Python Lists
- Python Tuples
- Sets in Python
- Python Dictionary
- Python Loops and Control Flow
- Python Conditional Statements
- Python Loops
- Python Functions
- Python OOPS Concept
- Python Data Structures
- Python DSA
- Linked List
- Stack
- Queue
- Tree
- Heap
- Hashing
- Graph
- Sets
- Map
- Advance Data Structure
- Sorting Algorithms
- Searching Algorithms
- Python Exception Handling
- Python File Handling
- Python Exercises
- Python List Exercise
- Python String Exercise
- Python Tuple Exercise
- Python Dictionary Exercise
- Python Set Exercise
- Python Design Patterns
- Python Programming Examples
- Python Practice Questions
- Java
- Java Programming Language
- Java Tutorial
- Data Types
- Variables
- Operators
- Flow Control in Java
- Loops in Java
- Methods
- Strings
- Arrays
- OOPs Concepts
- OOPs Concepts
- Classes and Objects
- Access Modifiers
- Inheritance
- Abstraction
- Encapsulation
- Polymorphism
- Interface
- Packages
- Multithreading
- File Handling
- Regular Expression
- Java Collections
- Java Collections
- Collection Class
- List Interface
- ArrayList
- LinkedList Class
- Queue Interface
- Set Interface
- HashSet Class
- Map Interface
- HashMap Class
- HashTable Class
- Iterator
- Comparator
- Collection Interview Questions
- Java 8 Tutorial
- Java Programs
- Java Programming Examples
- Java Array Programs
- Java String Programs
- Java Date-Time Programs
- Java File Handling Programs
- Java Collection Programs
- Java JDBC Programs
- Java Apache POI Programs
- Java OpenCV Programs
- Java Interview Questions
- Java Interview Questions
- Core Java Interview Questions-Freshers
- Java Multithreading Interview Questions
- OOPs Interview Questions and Answers
- Java Exercises
- Java Quiz
- Java Quiz
- Core Java MCQ
- Java Projects
- Advance Java
- Spring Tutorial
- Spring Boot Tutorial
- Spring Boot Interview Questions
- Spring MVC Tutorial
- Spring MVC Interview Questions
- Hibernate Tutorial
- Hibernate Interview Questions
- Java Programming Language
- Programming Languages
- C
- C++
- JavaScript
- PHP
- R Tutorial
- C#
- SQL
- Scala
- Perl
- Go Language
- Kotlin
- System Design
- System Design Tutorial
- What is System Design
- Key Terminologies in System Design
- Analysis and Architecture of Systems
- Scalability in System Design
- Databases in System Design
- High Level Design or HLD
- Low Level Design or LLD
- Case Studies in Designing Systems
- Complete System Design Tutorial
- Software Design Patterns
- System Design Roadmap
- Top 10 System Design Interview Questions and Answers
- System Design Tutorial
- Interview Corner
- Company Preparation
- Top Topics
- Practice Company Questions
- Interview Experiences
- Experienced Interviews
- Internship Interviews
- Competitive Programming
- Multiple Choice Quizzes
- Aptitude for Placements
- Computer Science Subjects
- Operating System
- DBMS
- Computer Networks
- Engineering Mathematics
- Computer Organization and Architecture
- Theory of Computation
- Compiler Design
- Digital Logic
- Software Engineering
- DevOps
- GIT
- AWS
- Docker
- Kubernetes
- Microsoft Azure Tutorial
- Google Cloud Platform
- Linux
- Linux Tutorial
- Linux Commands A-Z
- Linux Commands Cheatsheet
- File Permission Commands
- Linux System Administration
- Linux File System
- Linux Shell Scripting
- Linux Networking
- Linux Interview Questions
- Software Testing
- Software Testing Tutorial
- Software Engineering Tutorial
- Testing Interview Questions
- Jira
- Databases
- DBMS Tutorial
- SQL Tutorial
- PostgreSQL Tutorial
- MongoDB Tutorial
- SQL Interview Questions
- MySQL Interview Questions
- PL/SQL Interview Questions
- Android
- Android Tutorial
- Android Studio Tutorial
- Kotlin For Android
- Android Projects
- Android Interview Questions
- 6 Weeks of Android App Development
- Excel
- MS Excel Tutorial
- Introduction to MS Excel
- Data Analysis in Excel
- Basic Excel Formulas & Functions
- Data Analysis in Advanced Excel
- Workbooks
- Statistical Functions
- Data Visualization in Excel
- Pivot Tables in Excel
- Excel Spreadsheets in Python
- Basic Excel Shortcuts
- Mathematics
- Number System
- Algebra
- Linear Algebra
- Trigonometry
- Set Theory
- Statistics
- Probability
- Geometry
- Mensuration
- Logarithms
- Calculus
- Python Tutorial
- DSA
- Data Structures
- Arrays
- Matrix
- Strings
- Linked List
- Singly Linked List
- Doubly Linked List
- Circular Linked List
- Doubly Circular Linked List
- Linked List Tutorial
- Stack
- Queue
- Tree
- Generic Tree
- Binary Tree
- Binary Search Tree
- AVL Tree
- B Tree
- B+ Tree
- Red Black Tree
- Tree Data Structure Tutorial
- Heap
- Hashing
- Graph
- Set Data Structure
- Map Data Structure
- Advanced Data Structure
- Data Structures Tutorial
- Algorithms
- Analysis of Algorithms
- Design and Analysis of Algorithms
- Asymptotic Analysis
- Asymptotic Notations
- Worst, Average and Best Cases
- Searching Algorithms
- Linear Search
- Binary Search
- Searching Algorithms Tutorial
- Sorting Algorithms
- Selection Sort
- Bubble Sort
- Insertion Sort
- Merge Sort
- Quick Sort
- Heap Sort
- Counting Sort
- Radix Sort
- Bucket Sort
- Sorting Algorithms Tutorial
- Greedy Algorithms
- Dynamic Programming
- Graph Algorithms
- Pattern Searching
- Recursion
- Backtracking
- Divide and Conquer
- Mathematical Algorithms
- Geometric Algorithms
- Bitwise Algorithms
- Randomized Algorithms
- Branch and Bound
- Algorithms Tutorial
- Analysis of Algorithms
- DSA Tutorial
- Practice
- All DSA Problems
- Problem of the Day
- Company Wise Coding Practice
- Amazon
- Microsoft
- Flipkart
- Explore All
- GfG SDE Sheet
- Practice Problems Difficulty Wise
- School
- Basic
- Easy
- Medium
- Hard
- Language Wise Coding Practice
- CPP
- Java
- Python
- Curated DSA Lists
- Beginner's DSA Sheet
- Top 50 Array Problems
- Top 50 String Problems
- Top 50 DP Problems
- Top 50 Graph Problems
- Top 50 Tree Problems
- Competitive Programming
- Company Wise SDE Sheets
- Facebook SDE Sheet
- Amazon SDE Sheet
- Apple SDE Sheet
- Netflix SDE Sheet
- Google SDE Sheet
- DSA Cheat Sheets
- SDE Sheet
- DSA Sheet for Beginners
- FAANG Coding Sheet
- Product-Based Coding Sheet
- Company-Wise Preparation Sheet
- Top Interview Questions
- Puzzles
- All Puzzles
- Top 100 Puzzles Asked In Interviews
- Top 20 Puzzles Commonly Asked During SDE Interviews
- Data Structures
- Data Science
- Python Tutorial
- R Tutorial
- Machine Learning
- Data Science using Python
- Data Science using R
- Data Science Packages
- Pandas Tutorial
- NumPy Tutorial
- Data Visualization
- Python Data Visualization Tutorial
- Data Visualization with R
- Data Analysis
- Data Analysis with Python
- Data Analysis with R
- Deep Learning
- NLP Tutorial
- Web Tech
- HTML Tutorial
- CSS Tutorial
- JavaScript Tutorial
- PHP Tutorial
- ReactJS Tutorial
- NodeJS Tutorial
- AngularJS Tutorial
- Bootstrap Tutorial
- Typescript
- Web Development Using Python
- Django
- Django Tutorial
- Django Projects
- Django Interview Questions
- Flask
- Flask Tutorial
- Flask Projects
- Flask Interview Questions
- Postman
- Github
- Django
- Wordpress Tutorial
- Web Design
- Cheat Sheets
- HTML Cheat Sheet
- CSS Cheat Sheet
- JavaScript Cheat Sheet
- React Cheat Sheet
- Angular Cheat Sheet
- jQuery Cheat Sheet
- Bootstrap Cheat Sheet
- Learn Complete Web Development
- Courses
- Coding for Everyone
- DSA to Development
- Machine Learning & Data Science
- Generative AI & ChatGPT
- Become AWS Certified
- DSA Courses
- Data Structure & Algorithm(C++/JAVA)
- Data Structure & Algorithm(Python)
- Data Structure & Algorithm(JavaScript)
- Programming Languages
- CPP
- Java
- Python
- JavaScript
- C
- HTML Tutorial
- HTML Exercises
- HTML Tags
- HTML Attributes
- Global Attributes
- Event Attributes
- HTML Interview Questions
- HTML DOM
- DOM Audio/Video
- HTML 5
- HTML Examples
- Color Picker
- A to Z Guide
- HTML Formatter
- HTML accept Attribute
- HTML accept-charset Attribute
- HTML accesskey Attribute
- HTML action Attribute
- HTML align Attribute
- HTML alt attribute
- HTML | async Attribute
- HTML autocomplete Attribute
- HTML autoplay Attribute
- HTML autofocus Attribute
- HTML bgcolor Attribute
- HTML border attribute
- HTML | charset Attribute
- HTML checked Attribute
- HTML | cite attribute
- HTML Class Attribute
- HTML cols Attribute
- HTML colspan Attribute
- HTML | content Attribute
- HTML contenteditable Attribute
- HTML | controls Attribute
- HTML | coords Attribute
- HTML | data Attribute
- HTML | data Attribute
- HTML datetime Attribute
- HTML | default Attribute
- HTML | defer Attribute
- HTML dir Attribute
- HTML | dirname Attribute
- HTML | disabled Attribute
- HTML | download Attribute
- HTML draggable Attribute
- HTML | dropzone Attribute
- HTML enctype Attribute
- HTML | for Attribute
- HTML form Attribute
- HTML formaction Attribute
- HTML headers attribute
- HTML height Attribute
- HTML hidden Attribute
- HTML | high Attribute
- HTML href Attribute
- HTML hreflang Attribute
- HTML | http-equiv Attribute
- HTML Id Attribute
- HTML | ismap Attribute
- HTML | kind Attribute
- HTML label Attribute
- HTML lang Attribute
- HTML list Attribute
- HTML | loop Attribute
- HTML | low Attribute
- HTML max attribute
- HTML maxlength Attribute
- HTML media attribute
- HTML | method Attribute
- HTML min Attribute
- HTML | multiple Attribute
- HTML | muted Attribute
- HTML name Attribute
- HTML | novalidate Attribute
- HTML | onblur Attribute
- HTML oncopy Attribute
- HTML oncut Attribute
- HTML | onkeypress Attribute
- HTML | onmousedown Attribute
- HTML onscroll Attribute
- HTML Optimum Attribute
- HTML | pattern Attribute
- HTML placeholder Attribute
- HTML readonly Attribute
- HTML required Attribute
- HTML reversed Attribute
- HTML | rows Attribute
- HTML rowspan Attribute
- HTML selected Attribute
- HTML size Attribute
- HTML | srclang Attribute
- HTML | start Attribute
- HTML | step Attribute
- HTML style attribute
- HTML tabindex Attribute
- HTML | target Attribute
- HTML title Attribute
- HTML5 translate Attribute
- HTML | value Attribute
- HTML | wrap Attribute
The rowspan attribute in HTML specifies the number of rows a cell should span. That is if a row spans two rows, it means it will take up the space of two rows in that table. It allows the single table cell to span the height of more than one cell or row. It provides the same functionality as “merge cell” in a spreadsheet program like Excel.
Note: The rowspan attribute when used with <td> tag determines the number of standard cells it should span.
Syntax:
<td rowspan = "value">table content...</td>Usage
It can be used with <td> and <th> elements in an HTML Table.
Attribute Values:
Attribute Values | Description |
---|---|
number | Indicates how many rows a cell should cover. Using `rowspan=”0″` instructs the browser to extend the cell to the last row of the table section (thead, tbody, or foot). |
Using with <td> tag
The rowspan attribute when used with <td> tag determines the number of standard cells it should span.
Syntax:
<td rowspan = "value">table content...</td>// The value specifies the number of rows that the cell fills and it must be integerExample: The implementation of rowspan attribute with the td attribute
html
<!DOCTYPE html> <html> <head> <title>HTML rowspan Attribute</title> <style> table, th, td { border: 1px solid black; border-collapse: collapse; padding: 6px; } </style> </head> <body style="text-align:center"> <h1 style="color: green;">GeeksforGeeks</h1> <h2>HTML rowspan Attribute</h2> <table> <tr> <th>Name</th> <th>Age</th> </tr> <tr> <td>Ajay</td> <!-- This cell will take up space on two rows --> <td rowspan="2">24</td> </tr> <tr> <td>Priya</td> </tr> </table> </body> </html> |
Output:
Using with <th> tag
The rowspan attribute when used with <th> tag determines the number of header cells it should span.
Syntax:
<th rowspan = "value">table content...</th>// The value specifies the number of rows that the cell fills and it must be integerExample: The implementation of rowspan attribute with th attribute
html
<!DOCTYPE html> <html> <head> <title>HTML rowspan Attribute</title> <style> table, th, td { border: 1px solid black; border-collapse: collapse; padding: 6px; } </style> </head> <body style="text-align:center"> <h1 style="color: green;">GeeksforGeeks</h1> <h2>HTML rowspan Attribute</h2> <table> <tr> <th>Name</th> <th>Age</th> <!-- This cell will take up space in 3 rows --> <th rowspan="3">GeeksforGeeks</th> </tr> <tr> <td>Arun</td> <td>24</td> </tr> <tr> <td>Priya</td> <td>25</td> </tr> </table> </body> </html> |
Output:
Supported Browsers:
- Google Chrome 1
- Microsoft Edge 12
- Firefox 1
- Opera 12.1
- Safari 1
V
Vishal Chaudhary 2 Follow Improve Previous Article HTML | rows Attribute Next Article HTML selected AttributePlease Login to comment...
Similar Reads
HTML | rowspan Attribute The HTML <th> rowspan Attribute is used to specify how many numbers of header row cell will span. Syntax: <th rowspan="number"> Attribute Value: number: It contains the numeric value which specifies the number of rows the header cell should span. Example: C/C++ Code <!DOCTYPE html> <html> <head> <title> HTML th r 1 min read HTML | <td> rowspan Attribute The HTML <td> rowspan Attribute is used to specify the number of rows a cell should span. That is if a row spans two rows, it means it will take up the space of two rows in that table. It allows the single table cell to span the height of more than one cell or row. It provides the same functionality as “merge cell” in the spreadsheet program 1 min read HTML5 MathML rowspan Attribute This attribute holds the value that how many rows does the cell extend. This attribute is accepted by the <mtd> tag only. Syntax: <element rowspan="non-negative-int"> Attribute Values: non-negative-int: This value holds the integer that create the span by rows. Below example illustrate the rowspan in HTML MathML: Example: C/C++ Code 1 min read HTML | DOM TableData rowSpan Property The DOM TableData rowSpan Property in HTML DOM is used to set or return the value of the rowspan attribute. The rowspan attribute in HTML specifies the number of rows a cell should span. Syntax: It returns the rowSpan property. tabledataObject.rowSpanIt is used to set the rowSpan property. tabledataObject.rowSpan = number Property Values: It contai 2 min read HTML DOM TableHeader rowSpan Property The HTML DOM TableHeader rowSpan property is used to set or return the value of the rowspan attribute. The rowspan attribute in HTML specifies the number of rows a cell should span. Syntax: It returns the rowspan property.tableheaderObject.rowSpanIt is used to set the rowSpan property.tableheaderObject.rowSpan = number Property Values: It contains 2 min read HTML Table Colspan and Rowspan In HTML, the rowspan attribute specifies how many rows a table cell should span, determining its vertical position. On the other hand, the colspan attribute specifies the number of columns a cell should span, determining its horizontal position. Defining together, they provide a powerful mechanism for cells to cover multiple rows and columns, offer 3 min read How href attribute is different from src attribute in HTML ? In HTML5, the href and src attributes play distinct roles in defining paths or URLs, each associated with specific HTML elements. The href attribute, commonly found in an anchor (<a>) elements, points to the destination of hyperlinks, facilitating navigation. The src attribute, used with elements like <img> and <script>, specifies 1 min read When to use the class attribute and the id attribute ? The class attribute is used when multiple HTML elements share a common style or behaviour, allowing the application of a shared style to several elements. It promotes code reusability and is suitable for elements with similar characteristics. The id attribute is utilized when a unique identifier is needed for a specific HTML element. This identifie 1 min read How to use the target attribute and the rel attribute in the <a> Tag ? The target and rel attributes in the <a> (anchor) tag is used to control the behaviour of hyperlinks, specifying how the linked content should be opened and establishing relationships between the current and linked documents. Here's how to use these attributes: target Attribute:The target attribute determines where the linked content will be 2 min read HTML | <html> xmlns Attribute The HTML <html> xmlns Attribute is used to specify the xml namespace for a document. Important Note: This attribute is mainly required in XHTML, not valid in HTML 4.01, and optional in HTML 5. Syntax: <html xmlns="http://www.w3.org/1999/xhtml"> Attribute Values: https://www.geeksforgeeks.org/ It defines the namespace to use (for XHTML d 1 min read View More Articles Article Tags :- HTML-Attributes
- HTML
- Web Technologies
![three90RightbarBannerImg](https://media.geeksforgeeks.org/auth-dashboard-uploads/Must-do-coding-questions-with-bg-%281%29.png)
![geeksforgeeks-suggest-icon](https://media.geeksforgeeks.org/auth-dashboard-uploads/suggestChangeIcon.png)
![geeksforgeeks-improvement-icon](https://media.geeksforgeeks.org/auth-dashboard-uploads/createImprovementIcon.png)
What kind of Experience do you want to share?
Interview Experiences Admission Experiences Career Journeys Work Experiences Campus Experiences Competitive Exam Experiences Can't choose a topic to write? click here for suggested topics Write and publish your own ArticleTừ khóa » Html Table Rowspan Colspan Examples
-
HTML Table Colspan & Rowspan - W3Schools
-
Table Rowspan And Colspan In HTML Explained (With Examples) »
-
What Are Table Rowspan And Colspan In HTML? - Tutorialspoint
-
Live Demo: Example Of HTML Table Rowspan And Colspan
-
HTML Table Colspan And Rowspan - Mockstacks Free Tutorials For ...
-
Table Colspan And Rowspan In HTML - Dot Net Tutorials
-
Table Colspan And Rowspan - HTML
-
HTML Table Tag | Tr, Td, Rowspan, Colspan, Cellspacing Cellpadding
-
Html Table Rowspan And Colspan Code Example - Code Grepper
-
HTML Table Rowspan And Colspan
-
HTML Table Tutorial - COLSPAN And ROWSPAN - Linuxtopia
-
Tables: Rowspan And Colspan - HTML Dog
-
Colspan & Rowspan - The Complete HTML5 Tutorial