From 4eb344cc1aa9ac06329498b384fedb4dcc697f73 Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Sun, 8 May 2011 07:51:36 +0100 Subject: [PATCH] Fix: When calculating the width for tables, need to consider TH elements as well as TD in the body. Also correctly consider complex headers --- media/js/jquery.dataTables.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/media/js/jquery.dataTables.js b/media/js/jquery.dataTables.js index 445cf93f..5ef45114 100644 --- a/media/js/jquery.dataTables.js +++ b/media/js/jquery.dataTables.js @@ -5590,10 +5590,10 @@ * first of all try to use the elements in the body, but it is possible that there are * no elements there, under which circumstances we use the header elements */ - var oNodes = $("tbody tr:eq(0)>td", nCalcTmp); + var oNodes = $("tbody tr:eq(0)", nCalcTmp).children(); if ( oNodes.length === 0 ) { - oNodes = $("thead tr:eq(0)>th", nCalcTmp); + oNodes = _fnGetUniqueThs( oSettings, $('thead', nCalcTmp)[0] ); } iCorrector = 0;