Skip to main content
Inspiring
March 4, 2009
Question

Simple LinkElement Layout question

  • March 4, 2009
  • 3 replies
  • 644 views
I have a paragraph with two link elements.
I want one to be left aligned (against the left margin) and one to be right aligned(against the right margin).

For the life of me, I cannot get this to work.
I thought a simple set of spans inside the <P> with the textAlign would do it, but alas the links dont show up inside spans. ( <p><span textAlign='left'><a...>...</a></span><span textAlign='right'><a ...>...</a></span></p> )

Any help is greatly appreciated, and sorry for the newbie-like question.
Tim
This topic has been closed for replies.

3 replies

tpf70Author
Inspiring
March 4, 2009
MuhammadAhmed,
thanks for th advice, but unfortunately, your proposal also has many side effects.

First, When the baselineShift is added, there is then a vertical gap where the line was supposed to be. Still, if I set the lineHeight to 0, the gap goes away. However, the Link moves up, but the clickable region of the link does not. What I mean by that is in order to invoke the link, I have to move my mouse over the location where the anchor tag is supposed to be without the baselineShift. Maybe this is a bug???

Let's assume this is a bug and can be fixed. There is still one last problem. When using linked containers, and the "container break" occurs between the two P elements, the second P ends up in the second container despite the fact that it should be loacted at the same vertical location as the first paragraph. Apparently the baselineShift is not taken into consideration when determining container parenting of Flow Elements. Maybe this is a bug???

This is pretty unfortunate, as it seems like a basic function to put two spans on the same paragraph and set the text aligns opposite each other.

Thanks for your attempt. It is appreciated.
Tim
Participant
March 4, 2009
Thanks for the reply Robin.

I thought of using a tab stop, but the problem with this solution is that the width of my container is variable, and resizable. So with a fixed tab stop, there is no guarantee that the words will always be on the same line. If the width shrinks to smaller than the tab stop, the line will wrap.

Surely there must be a way to accomplish this. It seems so basic.
Participating Frequently
March 4, 2009
One workaround for this could be that you create two paragraphs containing links. Set first's alignment to left and the other ones to right. And then set the second paragraph's baselineShift to negative.

Ahmed
Adobe Employee
March 4, 2009
You could try markup something like this:
<p tabStops="e802"><span>X<tab/>Y</span></p>

This assumes a container size of 802. Basically you have two words, with a right-aligned tab in between. You could substitute your two links where I put two words, and it ought to work fine.