<?xml version="1.0" encoding="utf-8"?>

Adding padding

Adding padding Bad Practice
Adding padding Best Practice

By default, table cells are just large enough to fit their content. If you want to add more space around the content, use the padding property. It's a shorthand that allows you to set the padding for each side in one property. The padding property can take 4, 3, 2, and 1 values.

Depending on the number of values, it sets the padding for the following sides:

• 4 values: top, right, bottom, left

• 3 values: top, left&right, bottom

• 2 values: top&bottom, left&right

• 1 value: all sides[1]

In the example above ”padding:20px 30px;” sets the top and bottom padding to 20px and the left and right padding to 30px.

Improve your UX & Product skills with interactive courses that actually work