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
https://forums.phpfreaks.com/topic/133061-table-resize-help/
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
https://forums.phpfreaks.com/topic/133061-table-resize-help/#findComment-692133
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.