Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


Right justify last line of text?

Posted on 2006-11-13
Medium Priority
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?

Question by:boricua1213
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
LVL 19

Expert Comment

ID: 17934848

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

Author Comment

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

Expert Comment

ID: 17934889
Ah, right, sorry:
<span style="float: right;">link</div>
Plesk WordPress Toolkit

Plesk's WordPress Toolkit allows server administrators, resellers and customers to manage their WordPress instances, enabling a variety of development workflows for WordPress admins of all skill levels, from beginners to pros.

See why 2/3 of Plesk servers use it.


Author Comment

ID: 17934904
Nope same thing
LVL 19

Accepted Solution

VoteyDisciple earned 2000 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.

Author Comment

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.


Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmakerā€¦
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses

636 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