Jump to content

Table Resize help


nemesis.2002

Recommended Posts

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>

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.