/    Sign up×
Community /Pin to ProfileBookmark

Table Borders

Hi there,

I’ve got 2 classes… one called tblNormal, and another called tblHover. The tblNormal is applied to some <TD>’s, and tblHover is used in an onMouseOver event, which changes the background colour, and puts a border round the <TD>. The problem I have is that when you hover over the <TD> it pushes everything along by 1 pixel, as it’s adding a border round it. I can put a border on the tblNormal class, but i’m using the DXTransform.Microsoft.Gradient filter on them, which means whatever static color border I put on the tblNormal class, it will show!

Is there a way I can specify a hidden 1px border on the tblNormal class, or another way of accomplishing my goal?

Thanks very much

to post a comment
CSS

2 Comments(s)

Copy linkTweet thisAlerts:
@DaveSWMay 26.2005 — padding?

e.g. in CSS

padding-left: 1px;
Copy linkTweet thisAlerts:
@NogDogMay 26.2005 — padding?

e.g. in CSS

padding-left: 1px;[/QUOTE]

That's what I do for that sort of thing: reduce the padding by the amount of the border's width:
[code=html]
.class { padding: 2px 4px; }
.class:hover { padding: 1px 3px; border: solid 1px black; }
[/code]
×

Success!

Help @ldoodle 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.28,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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