
- 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 - Nested Tables
Nested Tables
HTML nested tables refer to the table where one or more tables are placed inside it; the inner tables are placed inside the Not only can tables be nested, but various HTML tags can also be used within the Nested tables refer to the practice of embedding an entire table structure within a cell of another table. This technique allows for the creation of more complex and structured layouts in HTML. See this image of how a nested table looks like i.e., this image demonstartes a structure of nested tables: You can create a nested table in HTML by creating one or more tables in different table cells. The following are the steps to create an HTML nested table: Begin by creating the outer table, which serves as the container. Within the outer table, define the necessary rows and columns. Inside the cell, embed a new table structure using the Within the inner table, define rows and columns as needed. Ensure proper closure of all HTML tags. Following is an example by following the above steps − Tables can be nested within table cells, allowing for complex structures. The following example creates a table with two columns (Name and Salary). Inside the first column, there's a nested table displaying employee details with the same columns. The outer table's header and data rows are defined, and the inner table showcases two employees, Ramesh Raman, and Shabbir Hussein, with corresponding salaries. You can apply styles to nested tables just like regular tables to enhance visual appearance. To write CSS styles for nested tables, you can simply apply the CSS rules on the 'table' selector to style the outer table and use the 'table table' selector to style the inner tables. The following code includes a main table styled with CSS properties. The `border-collapse` ensures seamless borders, and 'width: 100%' makes it responsive. Cells ( Additionally, nested tables within cells inherit a distinctive style, including a colored background and borders. The main table's data cell contains a nested table with a blue border, 80% width, and centered using 'margin: 10px auto'. Embedding images within nested tables enhances visual presentation. Use the The following example illustrates the use of images inside nested tables: Following are the advantages of the nested tables − Organized Layouts − Nested tables enable the creation of organized and structured layouts, enhancing the presentation of complex data. Cell Customization − Each cell in a nested table can contain diverse content, including text, images, or even additional nested tables. Complex Designs − Achieve intricate design patterns by nesting tables within cells, providing flexibility in webpage design. tag. The nested tables involve the utilization of one table within another, providing a versatile way to structure complex data layouts. Various elements, including other HTML tags, can be incorporated within table cells ( ).
(table data) tag for arranging contents in a structured manner.
Basic Structure of Nested Tables
How To Create a Nested Table?
Step 1: Create Outer Table
Step 2: Define Rows and Columns
Step 3: Embed Inner Table
tags.
Step 4: Define Inner Table Content
Inner Content
Step 5 - Close Tags
Example of Nested Tables
Name
Salary
Ramesh Raman
5000
Shabbir Hussein
7000
Tables Within Cells
Example
Name
Salary
Name
Salary
Ramesh Raman
5000
Shabbir Hussein
7000
Styling Nested Tables
Example
, ) have padding, border, and text alignment.
Name
Salary
Name
Salary
Ramesh Raman
5000
Shabbir Hussein
7000
Images in Nested Tables
tag inside table cells to seamlessly integrate images into complex layouts like nested tables.
Example
Image
Name
LOGO
HTML5
Benefits of Nested Tables