{"id":294643,"date":"2019-08-19T12:25:08","date_gmt":"2019-08-19T19:25:08","guid":{"rendered":"https:\/\/css-tricks.com\/?page_id=294643"},"modified":"2022-11-17T07:34:08","modified_gmt":"2022-11-17T15:34:08","slug":"border-spacing","status":"publish","type":"page","link":"https:\/\/css-tricks.com\/almanac\/properties\/b\/border-spacing\/","title":{"rendered":"border-spacing"},"content":{"rendered":"\n

The border-spacing<\/code> property in CSS controls how far apart cells are in a <table><\/code> element (or an element that is made to be table-like via display: table;<\/code>).<\/p>\n\n\n\n

It takes any of the lengths of CSS<\/a>. <\/p>\n\n\n\n

Notably, it only has any effect at all if the table is using the default border-collapse: separate;<\/code> and has no effect at all when border-collapse: collapse;<\/code> is set.<\/p>\n\n\n\n\n\n\n\n

table {\n  border-collapse: separate;\n\n  border-spacing: 5px;\n  border-spacing: 1vw;\n  border-spacing: 2em;\n}<\/code><\/pre>\n\n\n\n