Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

SeHyun Choi
SeHyun Choi
3,441 Points

Creating gutter space between columns

Hello I am trying to make 3 column layout but I can't create the gutter space between each column. When I give margin value to .col they all become one column layout. (.col is inside of .secondary-content and each columns are given class name of .first-column col, .second-column col, .third-column col)

.secondary-content {

}

.col { width:33%; float:left; }

2 Answers

Here is your magic:

.col {
  width: 33%;
  float: left;
}

/* Centers your text inside the tables. Unless you want something harder you need to adjust the table padding. (not margin) */
td{
  text-align:center;
}

/* Collapse squeezes all the tables together so you see 1 border line between the tables. */
table{
  border-collapse:collapse;
  padding:10px;
}

/* Add border to all tables except the last table. */
table:not(:last-child) {
  border-right:1px solid #666;
}