html - Width of a <td> is narrower when I use a <br> in it on a fixed width <table>. Why? -


i have html code fragment (in valid document using strict doctype):

<p>without &lt;br /&gt;</p> <table border="1" width="220"> <tbody>     <tr>         <td>lorem</td>         <td>ipsum</td>         <td>lorem ipsum</td>         <td>lorem</td>         <td>ipsum</td>     </tr> </tbody> </table>  <p>with &lt;br /&gt;</p> <table border="1" width="220"> <tbody>     <tr>         <td>lorem</td>         <td>ipsum</td>         <td>lorem<br>ipsum</td>         <td>lorem</td>         <td>ipsum</td>     </tr> </tbody> </table> 

this rendered in browser:

screenshot

please note third <td> wider in first table, because haven't used <br> tag there. otherwise code 2 tables identical.

i find way have table rendered on second example, without having use <br> tag.

clarification

i can't specify widths of cells because may contain number of characters.

seems ages old problem / question - unfortunately have no solution offer link 2005 proves struggling then. :)

http://www.velocityreviews.com/forums/t162343-how-to-prevent-unnecessary-table-resizing.html


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -