Topic: Opera redrawing table width |
|
---|---|
Author | Thread |
Bipolar (III) Inmate From: |
posted 03-04-2007 00:18
In a work-in-progress application of mine, I'm using JavaScript to dynamically alter the number of rows and columns in a table. Firefox and IE are cooperating with my code, but Opera, while changing the number of cells correctly, has some quirks in the way it redraws the table's width when the columns are altered.
|
Paranoid (IV) Inmate From: Norway |
posted 03-04-2007 15:23
It seems to work fine if you size properly the TD and TH. code: td,th { width:32px; height:32px; padding:1px; border:2px; } td img { width:32px; height:32px; } Remember that the CSS Box Model defines the width/height including the margins, padding and borders. Therefore the available width/height of the TD/TH is 32-(2+1)*2 = 26px. By placing a 32x32 IMG in the TD you confuse the rendering engine. Ok it should be able to deal with that, and it actually does if you force a reflow. But setting the width/height of the image to 26px should do the trick. You should also specify the line-height of the TD/TH to 26px; |
Bipolar (III) Inmate From: |
posted 03-04-2007 19:02
Thanks for your detailed answer. I'll try to consider all points of it. quote:
quote:
quote:
quote:
quote:
|
Paranoid (IV) Inmate From: Norway |
posted 03-04-2007 21:12
The easy way to force a reflow is to: board.style.display='none' at the beginning of setGame(), and board.style.display='' at the end. On desktop you can't see the board disapear. At all. And from the layout of page I doubt you aim at mobile phones. |
Bipolar (III) Inmate From: |
posted 03-05-2007 00:28
quote:
|