/    Sign up×
Community /Pin to ProfileBookmark

Tables, collapsing margins and being annoyed

I’ve been dealing a lot lately with TABLEs in with normal body text. Mix that up with headings where sometimes I want margins above or below, and sometimes I don’t, and other cases where I use the CAPTION as a heading and want to give it a top margin, and this just equals p***ing me off because margins on a TABLE do not [URL=”http://www.w3.org/TR/CSS21/box.html#collapsing-margins”]collapse like those of block elements[/URL]. I have yet to run across an instance where I thought, “man, I wish the margin on this table didn’t collapse, thereby causing the gap above and below it to double and make my content look ugly.”

I’ve solved it by creating various CSS classes I can apply to the TABLE tag to create a top margin, bottom margin, or both. Then I looked at it in Internet Explorer and it doesn’t seem to recognize margins on CAPTION tags, so I have to use padding. 😡

Has anyone else encountered this annoyance? Has anyone solved it?

to post a comment
CSS

0Be the first to comment 😎

×

Success!

Help @toicontien spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.5,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...