Midterm 2nd Sem Flashcards
(25 cards)
It offers a powerful tool for presenting data on your website, but mastering them goes beyond just rows and columns.
HTML Tables
An arrangement of data in rows and columns in tabular format. It useful for various tasks, such as presenting text information and numerical data. A tool for quickly and easily finding connections between different types of data. It is also used to create databases.
HTML Tables
Defines the structure for organizing data in rows and columns within a web page.
<table>
</table>
Represent a row within an HTML table, containing individual cells
<tr>
</tr>
Shows a table header cell that typically holds titles or headings
<th>
</th>
Represents a standard data cell, holding content or data
<td>
</td>
Provides a title or description for the entire table.
<caption>
</caption>
Defines the header section of a table, often containing column labels.
<thread>
</thread>
Represents the main content area of a table, separating it from the header or footer.
<tbody>
</tbody>
Specifies the footer section of a table, typically holding summaries or totals.
<tfoot>
</tfoot>
Defines attributes for table columns that can be applied to multiple columns at once.
<col></col>
Groups together a set of columns in a table to which you can apply formatting or properties collectively.
<colgroup>
</colgroup>
Syntax for adding a Border to an HTML Table
Syntax:
table, th, td {
border: 1px solid black;
}
Syntax for adding Collapsed Borders in an HTML Table
Syntax:
table, th, td {
border: 1px solid black;
border-collapse: collapse;
}
Syntax for adding Border Spacing in an HTML Table
Syntax:
table {
border-spacing: 5px;
}
Syntax for adding Cell Padding in an HTML Table
Syntax:
th, td {
padding: 20px;
}
Syntax for adding Left Align Headings in an HTML Table
Syntax:
th {
text-align: left;
}
Syntax for adding a Background Color to the Table
Syntax:
table#t01 {
width: 100%;
background-color: #f2f2d1;
}
It is set using the CSS border
property. If you do not specify a border for the table, it will be displayed without borders.
Border
For borders to collapse into one border, add the CSS border-collapse property.
Collapsed Border
It specifies the space between the cells. To set the border-spacing for a table, we must use the CSS border-spacing property.
Border Spacing
To make more than one column, we must use the colspan attribute.
Cell Span
It specifies the space between the cell content and its borders. If we do not specify a padding, the table cells will be displayed without padding.
Cell Padding
By default, the table headings are bold and centered. To left-align the table headings, we must use the CSS text-align property.
Left Align Heading