The document is a course outline for Web Technologies taught by Ms. Sahil Luthra at Amritsar College of Engineering & Technology. It covers various HTML table elements, including headers, data rows, captions, cell padding, and cell spacing, along with examples of their implementation. The document also highlights the differences between cell padding and cell spacing.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
3 views19 pages
Lec 5 Table
The document is a course outline for Web Technologies taught by Ms. Sahil Luthra at Amritsar College of Engineering & Technology. It covers various HTML table elements, including headers, data rows, captions, cell padding, and cell spacing, along with examples of their implementation. The document also highlights the differences between cell padding and cell spacing.
Header The header cells in a table are defined using the <th> element. These cells typically appear at the top of each column or at the beginning of each row, and they are usually styled differently (bold and centered by default) to distinguish them from the data cells.
<html > <head> <title>Table with Headers</title> </head> <body> <h1>Table with Headers</h1> <table border=”1″> <tr> <th>Header 1</th> <th>Header 2</th> </tr> <tr> <td>Data 1</td> <td>Data 2</td> </tr> </table> </body> </html> 3 Mr.Sahil Luthra [email protected] Web Technology Data rows Data rows in a table are defined using the <tr> element, and each data cell within a row is defined using the <td> element. These elements contain the actual data of the table.
Caption Tag The <caption> tag in HTML is used to provide a title or description for a <table> element. It helps give context or additional information about the content of the table. •The <caption> tag must be placed immediately after the opening <table> tag.
OBJECTIVES Caption Tag <html> <body> <table> <caption>Employee Details</caption> <tr> <th>Employee Name</th> <th>Position</th> </tr> <tr> <td>John</td> <td>Manager</td> </tr> <tr> <td>Emma</td> </tr> </table> </body> </html> Mr.Sahil Luthra [email protected] Web 7 Technology Using the Width and Border Attribute The HTML <table> border Attribute is used to specify the border of a table. It sets the border around the table cells. This attribute defines the visual presentation of the table by setting the thickness of the borders. A higher value results in a thicker border.
<h2>HTML table border Attribute</h2> <table border="1"> <caption>Author Details</caption> <tr> <th>NAME</th> <th>AGE</th> <th>BRANCH</th> </tr> <tr> <td>BITTU</td> <td>22</td> <td>CSE</td> </tr> <tr> <td>RAM</td> <td>21</td> <td>ECE</td> </tr> </table> </body> </html> 10 Mr.Sahil Luthra [email protected] Web Technology Cell Padding Cell padding is the space between the cell edges and the cell content. By default the padding is set to 0. Cellpadding specifies the space between the border of a table cell and its contents (i.e) it defines the whitespace between the cell edge and the content of the cell.
.com Web Technology Cellspacing Cellspacing specifies the space between cells (i.e) it defines the whitespace between the edges of the adjacent cells. Cell spacing is the space between each cell. By default the space is set to 2 pixels.
Difference between cellpadding and cellspacing: Cellpadding Cellspacing
It specifies the space between the border of a table
It specifies the space between adjacent cells. cell and its contents.
It is created by using HTML <table> tag but type It is also created by using HTML <table> tag but attribute is set to cellpadding. type attribute is set to cellspacing.
Cellspacing can get subjected to more than one
It is mainly meant for a single cell. cell.
The default cellpadding value is 1 Whereas, the default cellspacing value is 2
Cellpadding is widely used and considered to be
Cellspacing is less effective than Cellpadding. an effective mean
Cellpadding is an attribute Cellspacing is also an attribute.