/    Sign up×
Community /Pin to ProfileBookmark

padding around text in a cell

Hi everyone.

I would like to figure out how to have an equal amount of padding around different text lengths in a cell.

For example, lets say I have 4 different links in a horizontal navigation bar. Each link is a different sized word, like so:

home
vacancy
room views
contact

Now, how can I calculate how much space would go around each one, so that they all not only are centered, but also have the same space on either side of the word. Is there a general amount of space that each letter takes up in pixel size, so that it is easy to figure out?

This is one of those things I’ve had trouble with for a while, and just can’t seem to get right. I don’t want to create images for the links, I just want to have a html/css based link that looks uniformed.

Thanks for all of your help.

Brian

to post a comment
HTML

1 Comments(s)

Copy linkTweet thisAlerts:
@PeOfEoFeb 10.2004 — <td style="padding:10px;"> or <td style="padding-left:10px; padding-right:10px;"> just drop the width of the cells after that and it will stretch for the text and add 10 to either side and the text will be centered.
×

Success!

Help @blutopia 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.4,
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,
)...