HTML Tutorial 12 - Tables Video Lecture | HTML Basics- Create a designed webpage from Scratch - Software Development

17 videos

Top Courses for Software Development

FAQs on HTML Tutorial 12 - Tables Video Lecture - HTML Basics- Create a designed webpage from Scratch - Software Development

1. What is a table in HTML?
Ans. A table in HTML is a way to organize and display data in rows and columns. It is represented using the `<table>` tag and consists of one or more rows, which are defined using the `<tr>` tag, and cells within each row, defined using the `<td>` tag.
2. How can I create a table in HTML?
Ans. To create a table in HTML, you need to use the `<table>` tag to define the table, and then use the `<tr>` tag to define rows and the `<td>` tag to define cells within each row. Here's an example: ``` <table> <tr> <td>Cell 1</td> <td>Cell 2</td> </tr> <tr> <td>Cell 3</td> <td>Cell 4</td> </tr> </table> ``` This will create a basic table with 2 rows and 2 columns.
3. How can I add headers to my table in HTML?
Ans. To add headers to a table in HTML, you can use the `<th>` tag instead of the `<td>` tag for the cells in the first row. The `<th>` tag represents a header cell. Here's an example: ``` <table> <tr> <th>Header 1</th> <th>Header 2</th> </tr> <tr> <td>Cell 1</td> <td>Cell 2</td> </tr> </table> ``` In this example, the first row will be treated as the header row and the cells will be styled differently to indicate that they are headers.
4. Can I merge cells in a table using HTML?
Ans. Yes, you can merge cells in a table using the `colspan` attribute. The `colspan` attribute specifies the number of columns a cell should span. Here's an example: ``` <table> <tr> <td colspan="2">Merged Cell</td> <td>Cell 3</td> </tr> <tr> <td>Cell 1</td> <td>Cell 2</td> <td>Cell 3</td> </tr> </table> ``` In this example, the first cell in the first row spans 2 columns, resulting in a merged cell.
5. How can I add borders to my table in HTML?
Ans. To add borders to a table in HTML, you can use the CSS `border` property. You can apply the `border` property to the `<table>` element or specific elements within the table, such as the `<th>` and `<td>` elements. Here's an example: ```html <style> table { border: 1px solid black; border-collapse: collapse; } th, td { border: 1px solid black; padding: 8px; } </style> <table> <tr> <th>Header 1</th> <th>Header 2</th> </tr> <tr> <td>Cell 1</td> <td>Cell 2</td> </tr> </table> ``` In this example, the table and its cells will have a border of 1 pixel solid black. The `border-collapse: collapse;` property is used to ensure that adjacent borders merge into a single border.
17 videos
Explore Courses for Software Development exam
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev
Related Searches

ppt

,

Previous Year Questions with Solutions

,

Important questions

,

video lectures

,

Free

,

Extra Questions

,

pdf

,

Sample Paper

,

Summary

,

shortcuts and tricks

,

MCQs

,

past year papers

,

Exam

,

HTML Tutorial 12 - Tables Video Lecture | HTML Basics- Create a designed webpage from Scratch - Software Development

,

Semester Notes

,

mock tests for examination

,

practice quizzes

,

Viva Questions

,

study material

,

HTML Tutorial 12 - Tables Video Lecture | HTML Basics- Create a designed webpage from Scratch - Software Development

,

HTML Tutorial 12 - Tables Video Lecture | HTML Basics- Create a designed webpage from Scratch - Software Development

,

Objective type Questions

;