I am making some table content and got some problems.
When i want to add more text to first table column, it adds extra space do all other columns.
Here u can see what i am saying about

U can check my fiddle here
HTML
<table id="mytable" border="1">
<tr>
<td>
<img src="" />
<span>some text<br>asdasd<br>asdas</span>
</td>
<td>
<img src="" />
<span>some text</span>
</td>
</tr>
</table>
CSS
#mytable{
width:400px;
}
#mytable tr td{
padding:10px;
}
#mytable tr td img{
width:200px;
height:100px;
}
You should set the vertical-align for your td elements
#mytable tr td{
padding:10px;
vertical-align: top; /* Add this */
}
Demo
You could do it by using vertical-align: top; to #mytable tr td
HTML:
<table id="mytable" border="1">
<tr>
<td>
<img src="" /> <span>some text<br>asdasd<br>asdas</span>
</td>
<td>
<img src="" /> <span>some text</span>
</td>
</tr>
</table>
CSS:
#mytable{
width:400px;
}
#mytable tr td{
padding:10px;
vertical-align: top;
}
#mytable tr td img{
width:200px;
height:100px;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With