Solved

Right justify last line of text?

Posted on 2006-11-13
6
179 Views
Last Modified: 2006-11-18

My html code consists of a table.  In some of the cells I have text which almost takes up the whole cell.  I would like to add a link to the end of the text justified to the right on the same line as the last line of the text.

So it will be something like this:
text text texttext vtexttext text text v textvtext text v v vtext
texttex texxt                                                             link

I tried puting the link in a div with the display set to inline but I can't give it width.  The only way I made it work is by adding a bunch of  .

Any ideas?

Rick
0
Comment
Question by:boricua1213
  • 3
  • 3
6 Comments
 
LVL 19

Expert Comment

by:VoteyDisciple
ID: 17934848
Try...

text text text text text
text text text <div style="float: right;">link</div>
0
 
LVL 2

Author Comment

by:boricua1213
ID: 17934865
That does not keep the link on the same line as the last line of the text.  It makes a new line.
0
 
LVL 19

Expert Comment

by:VoteyDisciple
ID: 17934889
Ah, right, sorry:
<span style="float: right;">link</div>
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 2

Author Comment

by:boricua1213
ID: 17934904
Nope same thing
0
 
LVL 19

Accepted Solution

by:
VoteyDisciple earned 500 total points
ID: 17934962
Ahhh, I see what's going on, sure.

I've just tried this out and it works ok:

text text text
<span width="3em"></span> <!-- a span the width of your link text -->
<span style="float: right; margin-top: -1em;">link</span>


This explicitly moves the link up one line, but to make sure it won't end up overlapping other text at the end of the line there's explicitly a chunk of empty space at the end of the line.
0
 
LVL 2

Author Comment

by:boricua1213
ID: 17935080
OK that worked had to play around with the margin-top value to get it to lineup with the rest of the text.  Otherwise it did the job.

Thanks.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Read about why website design really matters in today's demanding market.
Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
The viewer will learn how to count occurrences of each item in an array.

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now