This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
en:web_development:tables:padding [2021/12/07 13:59] mag created |
en:web_development:tables:padding [2023/08/16 09:33] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Web Development Lesson | + | ====== Web Development Lesson |
- | ===== Padding | + | ===== Padding ===== |
==== Objective ==== | ==== Objective ==== | ||
In this activity we'll adjust the spacing between cells and within cells to make it more readable. | In this activity we'll adjust the spacing between cells and within cells to make it more readable. | ||
==== Setup ==== | ==== Setup ==== | ||
- | * Continue using your [[https:// | + | * Continue using ' |
**HTML** | **HTML** | ||
< | < | ||
Line 54: | Line 54: | ||
==== Padding ==== | ==== Padding ==== | ||
- | * Padding is the space between the element (in this case the text) and the border. | + | * Padding is the space between the boundary of an element (in this case the table cell) and its content. |
* Let's add 10 pixels around each side of the text in data cells. | * Let's add 10 pixels around each side of the text in data cells. | ||
* Because we only want to apply the padding to the data cells and not the header cells, we have to create a new target in the CSS code. | * Because we only want to apply the padding to the data cells and not the header cells, we have to create a new target in the CSS code. | ||
Line 63: | Line 63: | ||
padding-bottom: | padding-bottom: | ||
}</ | }</ | ||
+ | * This should be a lot more readable. | ||
==== Collapsing Borders ==== | ==== Collapsing Borders ==== | ||
Line 71: | Line 72: | ||
}</ | }</ | ||
* Does that look better? | * Does that look better? | ||
+ | |||
+ | ==== Tools: Developer Tools ==== | ||
+ | * Let's take a look at another tool that will help you as a developer. | ||
+ | * Open the menu of your browser. It's usually in the top right, but ask for help if you can't find it. | ||
+ | * Select 'More Tools' then ' | ||
+ | * This will open a panel on the bottom of your screen (Firefox) or the right of your screen (Chrome) with lots of tools that will help you understand what's going on in your page. Your browser size will be adjusted to cover the remaining area. | ||
+ | * If your Developer Tools hasn't opened in the ' | ||
+ | * You'll see the entire structure of your HTML code in a collapsible format in this tab. | ||
+ | * If you click on any of the tags you will see details of all the applied styles in the second pane, including any errors. | ||
+ | * In the last pane, you'll see a box model of the element including the padding. We'll look at this in more detail in the next lesson, but for now, notice that the padding is inside the border and something called a margin is outside the border. | ||
+ | * Click on any < | ||
+ | * Now click in the ' | ||
+ | * Type < | ||
+ | * This tool will allow you to view and edit your CSS rules without changing your files. It's a great place to test out the changes you want to make. | ||
+ | * Now try adding < | ||
+ | * You'll see an ' | ||
+ | * Try removing the ' | ||
+ | |||
+ | ==== Final Code ==== | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
[[en: | [[en: |