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 trialJacob Watton
3,465 PointsWouldn't you want to use 4+3n? The line with elements 13, 14 and 15 won't get the clear.
When you use 4n, the 2nd, 3rd and 4th row will all be effected, but the 5th row contains elements 13, 14, and 15 none of which are a multiple of 4. If we were to have this problem with a lot of elements, would the spacing on that row, and any other row that doesn't contain an element with index that is a multiple of 4, be incorrectly formatted?
2 Answers
Jeff Lemay
14,268 Points"n" basically stands for 0, 1, 2, 3, 4, 5, 6, and so on.
So if we have "4n", we are affecting elements:
- 4x0 = nothing
- 4x1 = 4th element
- 4x2 = 8th element
- 4x3 = 12th element
- 4x4 = 16th element
If we use "4+3n", we affect:
- 4+(3x0) = 4th element
- 4+(3x1) = 7th element
- 4+(3x2) = 10th element
- 4+(3x3) = 13th element
- 4+(3x4) = 16th element
Jacob Watton
3,465 PointsNevermind, it is answered in the code correction under the video.
Jacob Watton
3,465 PointsJacob Watton
3,465 PointsI understand that... My claim is that in the example you want to affect the 4th, 7th, 10th, etc elements because there are three columns.