nemesis.2002 Posted November 17, 2008 Share Posted November 17, 2008 Can't believe I'm asking a table question but here i go. I still use tables for web design. Divs never show up the same in different browsers. So i stick with my trusty tables but I've designed this back ground that is basicly a small dotted line. It's basically 4 pixels of white and then one pixel of black and then it repeats but when i tried putting this in a table when the text expands the cells some of the pixels are lost or simply misplaced. Is their a way to make the table expand only by a certain amount of pixels if it is going to expand at all? So for example if the text takes up 10 lines i'd like the cell to expand in multiples of 4px only. <table width="160" border="0" cellspacing="0" cellpadding="0"> <tr> <td> </td> <td> </td> <td> </td> </tr> <tr> <td></td> <td>much text here</td> <td></td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> </table> Quote Link to comment Share on other sites More sharing options...
haku Posted November 17, 2008 Share Posted November 17, 2008 The most efficient way (though not the most reliable) that I can think of to do this would be to use javascript to calculate the width of the table at a given time, rounding it up to increments of four pixels. This will be relatively processor heavy however, and will not work with users who have javascript turned off. Side note - it's worth the time to learn CSS. Divs do show up the same in different browsers once you know what you are doing, and after you have learned to layout pages using CSS, you will never go back (I speak from experience). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.