Solved

Right justify last line of text?

Posted on 2006-11-13
6
178 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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
Accessibility and Usability are two concepts that seem to be closely related.  But, too many people seem to have a distorted perception of them. During last five years, those two words have come to the day-to-day work of almost every web develope…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

747 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

10 Experts available now in Live!

Get 1:1 Help Now