04.06.2013 Views

Head First HTML with CSS

Head First HTML with CSS

Head First HTML with CSS

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

cells and the box model<br />

562 Chapter 13<br />

Table cells look like they<br />

just use the box model too...<br />

they’ve got padding and a border.<br />

Do they also have a margin?<br />

Table cells do have padding and a border – just<br />

like you’ve seen in the box model – but they<br />

are a little different when it comes to margins.<br />

The box model is a good way to think about table cells, but they do<br />

differ when it comes to margins. Let’s take a look at one of the cells<br />

in Tony’s table:<br />

Here’s the content.<br />

We call the space in between<br />

the cells border-spacing.<br />

So instead of a margin, we have a border-spacing property,<br />

which is defined over the entire table. In other words, you can’t set<br />

the “margin” of an individual table cell; rather, you set a common<br />

spacing around all cells.<br />

And here’s<br />

the padding.<br />

And here’s the border.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!