권리

2012-04-13 4 views
1

에 텍스트를 배치하는 방법 나는이 모형에서와 같이 오른쪽에있는 텍스트 "따방 uppfinnare"를 배치하고 싶습니다 : enter image description here권리

나는 오른쪽으로 텍스트 먼 제외한 모든 표시 할 때이 동적 데이터와 실제 결과는 다음과 같습니다

<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> 

당신이 내가 오른쪽에있는 텍스트를 달성 할 수있는 방법을 말해 주시겠습니까 : 이것이 않습니다 enter image description here

HTML 및 JSP? 나는 div와 함께 시도하고 뜨다 : 맞았지만 작동하지 않았다. 도와주세요. 고맙습니다.

답변

2

. 열에 대해 두 개의 div를 만듭니다.

<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; 
} 

확인 : example

2

이와 같은 절대 위치 지정을 사용할 수 있습니다. 같은 디자인에 더 적합 할 것 HTMLdiv 태그를 사용

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