2011-03-20 7 views
0

나는 그것을 건너 뛰고 PHP로 바로 가기로 결정 했으므로 HTML 초보자이다. 하지만 긴 텍스트 조각을 인쇄하는 스크립트를 가져 오는 중 HTML 테이블이 길어질 때마다 너비가 늘어나고 대신 다른 줄로 이동합니다. 어떻게 바꿀 수 있습니까? 감사합니다 : D테이블의 텍스트 크기가 증가하는 대신 테이블의 텍스트가 다른 라인으로 이동합니까?

Heres는 내 코드 :

<style type="text/css"> 
.style1 { 
    font-family: "Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande", "Lucida Sans", Arial, sans-serif; 
    background-image: url('file:///C:/wamp/www/style/images/banner.gif'); 
} 
.style2 { 
    font-size: small; 
    color: #62D7D7; 
} 
.style3 { 
    text-align: center; 
} 
.style4 { 
    font-family: "Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande", "Lucida Sans", Arial, sans-serif; 
    font-size: small; 
    color: #0070B8; 
} 
.style5 { 
    font-size: small; 
} 
</style> 




    <table align="center" style="width: 28%; height: 100px"> 
     <tr> 
      <td class="style1" colspan="2" style="height: 14px">&nbsp; JDiskwl1 
      <strong>&nbsp;</strong><span class="style2">frank james</span></td> 
     </tr> 
     <tr> 
      <td class="style3" style="width: 6px; height: 60px">Thumnail</td> 
      <td class="style5" style="height: 60px"><?php print $example ?></td> 
     </tr> 
     <tr> 
      <td class="style3" style="width: 6px">&nbsp;</td> 
      <td class="style4">Respond (244) Like (12)</td> 
     </tr> 
    </table> 
+0

당신이 당신의 문제가 코드를 게시 할 수 있습니까? 나는 당신이 내게 문제가 무엇인지 보여줄 수 없다면 도움을 줄 수 없다.) – Blender

+0

좋아, 내가 그것을 추가했다 :) – user663049

+0

또한 스타일을 추가하십시오. UI 요소의 동작 방식을 결정합니다. (스타일 1, 스타일 2 등) –

답변

1

당신이 찾고있는 무엇 : Rendered by Firefox 4 다음 코드는 트릭을 수행합니다

<html> 
     <head> 
       <style type="text/css"> 
         .style1 { 
           font-family: "Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande", "Lucida Sans", Arial, sans-serif; 
           background-image: url('file:///C:/wamp/www/style/images/banner.gif'); 
         } 
         .style2 { 
           font-size: small; 
           color: #62D7D7; 
         } 
         .style3 { 
           text-align: center; 
         } 
         .style4 { 
           font-family: "Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande", "Lucida Sans", Arial, sans-serif; 
           font-size: small; 
           color: #0070B8; 
         } 
         .style5 { 
           font-size: small; 
         } 
       </style> 
     </head> 
     <body> 


       <table style="width: 700px; margin: auto;"> 
         <tr> 
           <td class="style1" colspan="2" >JDiskwl1 <span class="style2">frank&nbsp;james</span></td> 
         </tr> 
         <tr> 
           <td class="style3">Thumnail</td> 
           <td class="style5">I am a complete novice at HTML as i decided to skip it and go straight to PHP. But i am getting a script to print long pieces of text and every time it is longer then the HTML table was set the width just grows instead of it going onto a different line. How do i change this? Thanks :D></td> 
         </tr> 
         <tr> 
           <td class="style3">&nbsp;</td> 
           <td class="style4">Respond (244) Like (12)</td> 
         </tr> 
       </table> 
     </body> 
</html> 
관련 문제