/    Sign up×
Community /Pin to ProfileBookmark

Using a <div> as a space filler

Hi,

I’m working on a website for a restaurant. On the menu section, the format is as such: In the first column is the dish name followed by a description (in a span) and then the price in the next column. What I want to do is put a div or a span (whatever would work) after the description and have it automatically stretch from the end of the description to the price column. I would then put a border on the bottom as dots so it has this effect:

Hamburger Delicious ………….. $4.95

The HTML would look something like this:

<td>Hamburger<span>Delicious</span><div style=”border-bottom:1px black;width:100%”></div><td>$4.95</td>

The problem is that a div automatically displays on the next line. If I set the display to inline, then I can’t set the width.

Using a column instead of a div/span will not work, since the names of the dishes vary greatly and a column will only be as small as the largest dish name.

Any ideas for a solution?

Thanks.

to post a comment
HTML

2 Comments(s)

×

Success!

Help @jyushinx 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.20,
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,
)...