Syncing column width of between tables in two different frames, etc

前端 未结 2 720
温柔的废话
温柔的废话 2020-12-19 09:19


For reasons which are somewhat unavoidable (lots of legacy code, compatibility, design needs) I have the following problem: I have two tables, one directly below the

2条回答
  •  死守一世寂寞
    2020-12-19 09:31

    I couldn't get the accepted answer to work directly, so I reworked it a bit, just in case it doesn't work for anyone else.

    $('.table1 tr:eq(1) td').each(function (i) {
                    var _this = $(this);
                    $('.table2 tr:eq(1) td:eq(' + i + ')').width(_this.width());
                });
    

提交回复
热议问题