Curriculum
Course: HTML Basic
Login

Curriculum

HTML Basic

HTML Introduction

0/1

HTML Editors

0/1

HTML Elements

0/1

HTML Attributes

0/1

HTML Headings

0/1

HTML Paragraphs

0/1

HTML Styles

0/1

HTML Formatting

0/1

HTML Quotation

0/1

HTML Comments

0/1

HTML Colors

0/1

HTML Favicon

0/1

HTML Page Title

0/1

HTML Block and Inline

0/1

HTML Iframes

0/1

HTML Java Script

0/1

HTML File Paths

0/1

HTML - The Head Element

0/1

HTML Style Guide

0/1

HTML Entities

0/1

HTML Symbols

0/1
Text lesson

Padding &Spacing

HTML tables offer options to adjust the padding within cells as well as the spacing between cells.

IMG_3838

 

HTML Table – Cell Padding

Cell padding refers to the distance between the edges of a cell and its content.

By default, this padding is set to 0.

To apply padding to table cells, utilize the CSS padding property.
Example

th, td {
  padding: 15px;
}

To exclusively include padding above the content, employ the padding-top property.

For the remaining sides, utilize the padding-bottom, padding-left, and padding-right properties.

Example

th, td {
  padding-top: 10px;
  padding-bottom: 20px;
  padding-left: 30px;
  padding-right: 40px;
}

HTML Table – Cell Spacing

Cell spacing refers to the gap between each cell, typically set to a default of 2 pixels.

To adjust the space between table cells, apply the CSS border-spacing property to the table element.

Example

table {
  border-spacing: 30px;
}

 

Click to Learn