narentera / flexigrid

Automatically exported from code.google.com/p/flexigrid
0 stars 0 forks source link

Column resizing fails if the cell contains a div or a table #1

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. create a 3 column table with a div in cell one
<table id="x">
    <thead>
        <tr>
            <th width="100px">a</td> </th>
            <th width="100px">b</td> </th>
            <th width="100px">c</td> </th>
        </tr>
    </thead>
    <tr>
        <td><div>1</div></td>
        <td>2</td>
        <td>3</td>
    </tr>
</table>
2. resize column 
3. width is changed on the div in the table cell

What is the expected output? What do you see instead?

header and cell dividers should have the same width when resized
width is changed on the div in the table cell
column sizing misaligned

What version of the product are you using? On what operating system?
1.0b3 2008-07-14

Original issue reported on code.google.com by rgmert...@gmail.com on 18 Jul 2008 at 10:43

GoogleCodeExporter commented 8 years ago
Replace line 239
        $('td:visible div:eq('+n+')',this).css('width',nw);
with                                    
    $('td:visible:eq('+n+') div:first',this).css('width',nw);

Original comment by rgmert...@gmail.com on 19 Jul 2008 at 11:47

GoogleCodeExporter commented 8 years ago
Replace the innerdiv with a table and move a column in front of it.
The fix does not address this

Original comment by rgmert...@gmail.com on 19 Jul 2008 at 11:51

GoogleCodeExporter commented 8 years ago
here is some table, that does not work

     <table class="table-flex">
      <thead>
        <tr>
          <th width="200">col1</th>
          <th width="100">col2</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td><div>1.1</div></td>
          <td>1.2</td>
        </tr>
        <tr>
          <td>2.1</td>
          <td><table><tr><td>2.2</td></tr></table></td>
        </tr>
      </tbody>

Original comment by daniel.s...@gmail.com on 21 Jul 2008 at 4:18

GoogleCodeExporter commented 8 years ago
Also note, that the feature of row striping stops to work when a nested table 
is in
inside a cell.

Original comment by daniel.s...@gmail.com on 28 Jul 2008 at 8:48

GoogleCodeExporter commented 8 years ago
<table id="x">
    <thead>
        <tr>
            <th width="100px">a</td> </th> -> this is not formatted properly, you closed a td without actually 
opening one, plus this my specification requires that you use th in the thead.
            <th width="100px">b</td> </th>
            <th width="100px">c</td> </th>
        </tr>
    </thead>
    <tr>
        <td><div>1</div></td>
        <td>2</td>
        <td>3</td>
    </tr>
</table> 

Original comment by paulo...@gmail.com on 15 Aug 2008 at 10:37

GoogleCodeExporter commented 8 years ago
 <td><div>1.1</div></td> -> yes this does not work because I handle column resizing using the width 
property of div rather the td.

Why?

Because div's are more accurate across different browsers. Some browsers tend 
to ignore the width styling of the 
cell.

Original comment by paulo...@gmail.com on 15 Aug 2008 at 10:39

GoogleCodeExporter commented 8 years ago
There is nothing wrong with your decision to use DIVs.. but you have to 
consider,
that there are tables, that have nested DIVs as well, where the resizing simply 
fails.

Please just copy paste my two examples and give it a try.

Original comment by daniel.s...@gmail.com on 16 Aug 2008 at 6:25

GoogleCodeExporter commented 8 years ago

Original comment by eric.caron on 22 Dec 2010 at 3:38

GoogleCodeExporter commented 8 years ago
Thank you for this solution daniel.soneira... it help me!

Original comment by jupet...@gmail.com on 20 Oct 2011 at 2:53