HTML TUTORIALS-
HTML Table Padding & Spacing Tag β
Introduction-
HTML Table Padding & Spacing Tag -
- In User or Coder write HTML code,When working with HTML tables, making them look clean and readable is just as important as displaying the data itself. Two key aspects that control the appearance of content inside a table are padding and spacing:-
-)πΉ What is Padding in HTML Tables?-πPadding refers to the space inside a table cellβbetween the content (text or images) and the cell border. It gives your content some breathing room, making the table more readable and visually appealing.π‘ How to Add Padding Example-π
<style> table, th, td { border: 1px solid black; padding: 10px; } </style>
<style>
table {
border: 1px solid black;
border-collapse: collapse;
}
th, td {
border: 1px solid black;
padding: 50px;
}
</style>
<table>
<tr>
<th>Product</th>
<th>Price</th>
</tr>
<tr>
<td>Deskstop</td>
<td>$500</td>
</tr>
</table>
Product | Price |
---|---|
Deskstop | $500 |
<style>
table {
border: 1px solid black;
border-collapse: separate;
border-spacing: 10px;
}
th, td {
border: 1px solid black;
padding: 5px;
}
</style>
<table border="1" cellspacing="10">
Tag | Purpose |
---|---|
<table> | Defines the table |
<tr> | Table row |
<th> | Table header (bold + centered by default) |
<td> | Table data (cell content) |
<caption> | Defines a table caption |
<colgroup> | Specifies a group of one or more columns in a table for formatting |
<col> | Specifies column properties for each column within a (colgroup) element |
<thead> | Groups the header content in a table |
<tbody> | Groups the body content in a table |
-Display Customer Payment History-s_ALR_87012177
-Create Expenses Paid BY Employee-FB01
-No taxes on sales/purch.are allowed for account 110002 1003,F1 is not allowed