2016-11-30 5 views
1

Ich erstellte eine HTML-Seite und ich verwendete Tabelle, aber ich habe ein Problem im ersten TD oben und ich bekomme einen leeren Platz.CSS für Tabelle td

Demo.

My Table Stil

<table width="100%"> 
 
    <tbody> 
 
    <tr> 
 
     <td style="" width="25%"> 
 
     <table cellspacing="0"> 
 
      <tbody> 
 
      <tr> 
 
       <td> 
 
       <img src="/avatar/thumb/1479077526.png" style="width:200px; height:200px;"> 
 
       </td> 
 
      </tr> 
 
      <tr> 
 
       <td><strong>und3rc00d3</strong> 
 
       </td> 
 
      </tr> 
 
      <tr> 
 
       <td>UserID: <strong>1</strong> 
 
       </td> 
 
      </tr> 
 
      </tbody> 
 
     </table> 
 
     </td> 
 
     <td> 
 
     <br> 
 
     <div id="akt"> 
 
      <div style="overflow-y:scroll; height:640px;"> 
 
      <table> 
 
       <tbody> 
 
       <tr> 
 
        <th>Aktivitetet e fundit</th> 
 
       </tr> 
 
       <tr> 
 
        <td>............ 
 
        </td> 
 
       </tr> 
 
       </tbody> 
 
      </table> 
 
      </div> 
 
     </div> 
 
     </td> 
 
    </tr> 
 
</table>

Zum ersten TD ich mit zu Stil versucht: position: absolute; aber auch hier hat es nicht http://prntscr.com/ddom11 arbeiten

+0

versuchen Sie "absolut". – Banzay

+0

ich versuchte aber wieder nicht funktionieren http://prntscr.com/ddom11 – und3rc00d3

+0

lesen Sie sorgfältig: ABSOLUTE - nicht abstruIte – Banzay

Antwort

1

Versuchen Hinzufügen style = "vertical-align : oben"; wie in dem Code unter

<table width="100%"> 
    <tbody> 
     <tr> 
      <td style="vertical-align:top" width="25%"> 
       <table cellspacing="0"> 
        <tbody> 
         <tr> 
          <td><img src="/avatar/thumb/1479077526.png" style="width:200px; height:200px;"></td> 
         </tr> 
         <tr> 
          <td><strong>und3rc00d3</strong></td> 
         </tr> 
         <tr> 
          <td>UserID: <strong>1</strong></td> 
         </tr> 
        </tbody> 
       </table> 
      </td> 
      <td> 
      <br> 
      <div id="akt"> 
       <div style="overflow-y:scroll; height:640px;"> 
        <table> 
         <tbody> 
          <tr> 
           <th>Aktivitetet e fundit</th> 
          </tr> 
          <tr> 
           <td>............</td> 
          </tr> 
         </tbody> 
        </table> 
       </div> 
      </div> 
      </td> 
     </tr> 
    </tbody> 
</table> 
+0

Das ist richtig. Sie können es nicht ohne Grenzen sehen, aber die eingestellte Höhe des zweiten td streckt das erste. Standardmäßige vertikale Ausrichtung in einem TD ist die Mitte. –

+0

es funktioniert dank – und3rc00d3