und3rc00d3 und3rc00d3 - 9 days ago 5
CSS Question

Css for table td

I created an HTML page and I used table, but i have a problem in first TD on top and I get a empty space.

Demo: http://prntscr.com/ddoi8q

My Table Style



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





For the first TD I tried to style with:
position: absolute;
but again it did not work http://prntscr.com/ddom11

Answer

Try adding style="vertical-align: top"; as in the code below

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