O'Reilly logo

Cascading Style Sheets (CSS) by Example by Steve Callihan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Controlling Spacing, Padding, and Borders

In the example HTML file for this chapter, a border="1" attribute is set in the TABLE element, causing a one-pixel border to be drawn around the table and its cells. This is included to help you visualize how cell spacing and padding is controlled in HTML and CSS. By default, browsers do not draw borders for tables, but they do insert spacing between cells (usually two pixels) and padding within cells (usually one pixel).

Controlling Spacing, Padding, and Borders with HTML

In HTML, the TABLE element's CELLSPACING and CELLPADDING attributes are used to set the amount of spacing that is displayed be- tween cells and the amount of padding that is inserted inside of cells. The BORDER attribute is used to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required