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

Adding borders

Adding borders

In older versions of HTML, we could add a border using the border attribute. However, this code is archaic and illustrates older conventions that you may come across while learning. In modern HTML versions, developers use CSS to add style as it's much more flexible and comprehensive.

When adding a border rule to the style sheet, keep in mind that it's applied separately for the border around the table and borders around cells. So, to set all borders for your tables, you need to apply the rule to all 3 elements: <table>, <th>, and <td>. As a result of this logic, the default border looks double.

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