1

I'd like to place the text "även uppfinnare" to the right like in this mockup: enter image description here

I can display everything except the text farthest to the right when this is the actual result with dynamic data: enter image description here

The HTML and JSP that does this is:

    <div class="clear"></div>

    <div class="fl10"><h3>Sökande</h3></div>
        <% if(apc.hasSokande()) {
        if(sokandeList != null && sokandeList.size() > 0) { %>
        <% for(PersonInfo person : sokandeList) { %>
        <div class="data-box">
            <table border="0">
    <tr><td colspan=3><strong>  <% if (person.getNamn() != null) { %>
                <%= person.getNamn() %>&nbsp;
            <% } %> </strong></td></tr>
        <tr><td></td><td>Telefon</td><td><%= person.getTelefon() %></td></tr>
        <tr><td></td><td>Fax</td><td><%= person.getFax() %></td></tr>
        <tr><td></td><td>E-post</td><td><%= person.getEpost() %></td></tr>
        <tr><td><%= person.getLandKod() %></td><td>Referens</td><td></td></tr>
        </table>    
    </div>  
</div>
    <div class="clear"></div>
    <div class="fl10"></div>


        <% } %>
    <% } %>
    <% } else { %>
        <%= apc.getNyregPerson().getNamn() %>
    <% } %>

        </div>

Can you please tell me how I can achieve the text on the right? I tried with a div and float:right but it didn't work. Please help. Thank you.

2 Answers 2

2

Using HTML div tag would be more suitable for such design. Create two divs for columns.

    <div id="personName">
      ......
   </div>
    <div id="otherDetails">
       .....
   </div>
   <br style="clear:both;"/>

CSS:

  #personName {
    float:left;
    width:300px;
    background:#9c9;
 }
 #otherDetails {
    float:right;
    width:450px;
    background:#c9c;
 }

Check : example

2

You can use absolute positioning like this one.

<span style='position:absolute; top:10px; right:0px;'>även uppfinnare</span>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.