$(document).ready(function() { $.fn.dataTable.ext.order['sortMln'] = function ( settings, col ) { return this.api().column( col, {order:'index'} ).nodes().map( function ( td ) { return 1*$(td).text().replace(' млн.', ''); } ); }; $.fn.dataTable.ext.order['sortCountryFlag'] = function ( settings, col ) { return this.api().column( col, {order:'index'} ).nodes().map( function ( td ) { return $('i', td).attr('title'); } ); }; $.fn.dataTable.ext.order['sortMostPopular'] = function ( settings, col ) { return this.api().column( col, {order:'index'} ).nodes().map( function ( td ) { return 1*$(td).text().substr(0,$(td).text().indexOf("x")-1); } ); }; }); var countries = {"214":{"id":"214","country":"England","countryCode":"EN","countryTr":"\u0410\u043d\u0433\u043b\u0438\u044f"},"215":{"id":"215","country":"Scotland","countryCode":"SF","countryTr":"\u0428\u043e\u0442\u043b\u0430\u043d\u0434\u0438\u044f"},"51":{"id":"51","country":"Australia","countryCode":"AU","countryTr":"\u0410\u0432\u0441\u0442\u0440\u0430\u043b\u0438\u044f"},"216":{"id":"216","country":"Wales","countryCode":"WL","countryTr":"\u0423\u044d\u043b\u044c\u0441"},"61":{"id":"61","country":"Netherlands","countryCode":"NL","countryTr":"\u041d\u0438\u0434\u0435\u0440\u043b\u0430\u043d\u0434\u044b"},"217":{"id":"217","country":"Northern Ireland","countryCode":"NIE","countryTr":"\u0421\u0435\u0432\u0435\u0440\u043d\u0430\u044f \u0418\u0440\u043b\u0430\u043d\u0434\u0438\u044f"},"36":{"id":"36","country":"Canada","countryCode":"CA","countryTr":"\u041a\u0430\u043d\u0430\u0434\u0430"},"93":{"id":"93","country":"Austria","countryCode":"AT","countryTr":"\u0410\u0432\u0441\u0442\u0440\u0438\u044f"},"14":{"id":"14","country":"Germany","countryCode":"DE","countryTr":"\u0413\u0435\u0440\u043c\u0430\u043d\u0438\u044f"},"28":{"id":"28","country":"Spain","countryCode":"ES","countryTr":"\u0418\u0441\u043f\u0430\u043d\u0438\u044f"},"118":{"id":"118","country":"Ireland","countryCode":"IE","countryTr":"\u0418\u0440\u043b\u0430\u043d\u0434\u0438\u044f"},"3":{"id":"3","country":"United States","countryCode":"US","countryTr":"\u0421\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u043d\u044b\u0435 \u0428\u0442\u0430\u0442\u044b"},"76":{"id":"76","country":"Belgium","countryCode":"BE","countryTr":"\u0411\u0435\u043b\u044c\u0433\u0438\u044f"},"88":{"id":"88","country":"Sweden","countryCode":"SE","countryTr":"\u0428\u0432\u0435\u0446\u0438\u044f"},"218":{"id":"218","country":"Gibraltar","countryCode":"GI","countryTr":"Gibraltar"},"74":{"id":"74","country":"Greece","countryCode":"GR","countryTr":"\u0413\u0440\u0435\u0446\u0438\u044f"},"33":{"id":"33","country":"Poland","countryCode":"PL","countryTr":"\u041f\u043e\u043b\u044c\u0448\u0430"},"2":{"id":"2","country":"India","countryCode":"IN","countryTr":"\u0418\u043d\u0434\u0438\u044f"},"26":{"id":"26","country":"South Africa","countryCode":"ZA","countryTr":"\u042e\u0436\u043d\u0430\u044f \u0410\u0444\u0440\u0438\u043a\u0430"},"109":{"id":"109","country":"Denmark","countryCode":"DK","countryTr":"\u0414\u0430\u043d\u0438\u044f"},"112":{"id":"112","country":"Finland","countryCode":"FI","countryTr":"\u0424\u0438\u043d\u043b\u044f\u043d\u0434\u0438\u044f"},"80":{"id":"80","country":"Hungary","countryCode":"HU","countryTr":"\u0412\u0435\u043d\u0433\u0440\u0438\u044f"},"120":{"id":"120","country":"Croatia","countryCode":"HR","countryTr":"\u0425\u043e\u0440\u0432\u0430\u0442\u0438\u044f"},"94":{"id":"94","country":"Swiss","countryCode":"CH","countryTr":"\u0428\u0432\u0435\u0439\u0446\u0430\u0440\u0438\u044f"},"117":{"id":"117","country":"Norway","countryCode":"NO","countryTr":"\u041d\u043e\u0440\u0432\u0435\u0433\u0438\u044f"},"23":{"id":"23","country":"Italy","countryCode":"IT","countryTr":"\u0418\u0442\u0430\u043b\u0438\u044f"},"145":{"id":"145","country":"Slovenia","countryCode":"SI","countryTr":"\u0421\u043b\u043e\u0432\u0435\u043d\u0438\u044f"},"116":{"id":"116","country":"Singapore","countryCode":"SG","countryTr":"\u0421\u0438\u043d\u0433\u0430\u043f\u0443\u0440"},"1":{"id":"1","country":"China","countryCode":"CN","countryTr":"\u041a\u0438\u0442\u0430\u0439"},"98":{"id":"98","country":"Hong Kong","countryCode":"HK","countryTr":"\u0413\u043e\u043d\u043a\u043e\u043d\u0433"},"10":{"id":"10","country":"Japan","countryCode":"JP","countryTr":"\u042f\u043f\u043e\u043d\u0438\u044f"},"12":{"id":"12","country":"Philippines","countryCode":"PH","countryTr":"\u0424\u0438\u043b\u0438\u043f\u0438\u043d\u044b"},"124":{"id":"124","country":"New Zealand","countryCode":"NZ","countryTr":"\u041d\u043e\u0432\u0430\u044f \u0417\u0435\u043b\u0430\u043d\u0434\u0438\u044f"},"78":{"id":"78","country":"Czech Republic","countryCode":"CZ","countryTr":"\u0427\u0435\u0445\u0438\u044f"},"142":{"id":"142","country":"Latvia","countryCode":"LV","countryTr":"\u041b\u0430\u0442\u0432\u0438\u044f"},"43":{"id":"43","country":"Malaysia","countryCode":"MY","countryTr":"\u041c\u0430\u043b\u0430\u0439\u0437\u0438\u044f"},"19":{"id":"19","country":"France","countryCode":"FR","countryTr":"\u0424\u0440\u0430\u043d\u0446\u0438\u044f"},"9":{"id":"9","country":"Russia","countryCode":"RU","countryTr":"\u0420\u043e\u0441\u0441\u0438\u044f"},"20":{"id":"20","country":"Thailand","countryCode":"TH","countryTr":"\u0422\u0430\u0439\u043b\u0430\u043d\u0434"},"132":{"id":"132","country":"Lithuania","countryCode":"LT","countryTr":"\u041b\u0438\u0442\u0432\u0430"},"17":{"id":"17","country":"Turkey","countryCode":"TR","countryTr":"\u0422\u0443\u0440\u0446\u0438\u044f"},"173":{"id":"173","country":"Brunei","countryCode":"BN","countryTr":"\u0411\u0440\u0443\u043d\u0435\u0439"},"5":{"id":"5","country":"Brasil","countryCode":"BR","countryTr":"\u0411\u0440\u0430\u0437\u0438\u043b\u0438\u044f"},"77":{"id":"77","country":"Portugal","countryCode":"PT","countryTr":"\u041f\u043e\u0440\u0442\u0443\u0433\u0430\u043b\u0438\u044f"},"81":{"id":"81","country":"Serbia","countryCode":"RS","countryTr":"\u0421\u0435\u0440\u0431\u0438\u044f"},"52":{"id":"52","country":"Romania","countryCode":"RO","countryTr":"\u0420\u0443\u043c\u044b\u043d\u0438\u044f"},"175":{"id":"175","country":"Iceland","countryCode":"IS","countryTr":"\u0418\u0441\u043b\u0430\u043d\u0434\u0438\u044f"},"22":{"id":"22","country":"United Kingdom","countryCode":"GB","countryTr":"\u0412\u0435\u043b\u0438\u043a\u043e\u0431\u0440\u0438\u0442\u0430\u043d\u0438\u044f"},"27":{"id":"27","country":"Ukraine","countryCode":"UA","countryTr":"\u0423\u043a\u0440\u0430\u0438\u043d\u0430"},"160":{"id":"160","country":"Bahrain","countryCode":"BH","countryTr":"\u0411\u0430\u0445\u0440\u0435\u0439\u043d"},"161":{"id":"161","country":"Guyana","countryCode":"GY","countryTr":"\u0413\u0430\u0439\u0430\u043d\u0430"}}; var teams = {"0":{"id":0,"name":""},"152":{"id":"152","name":"BDO","nameTranslated":"BDO"},"153":{"id":"153","name":"PDC","nameTranslated":"PDC"}}; var sportsmen = [{"id":"4932","tem":"153","ctr":"61","nam":"Gerwen, Michael van","namorig":"Gerwen, Michael van","cat":"","pri":"25 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Gerwen, Michael van<\/a>","confirmed_b":1},{"id":"4925","tem":"153","ctr":"215","nam":"Wright, Peter ","namorig":"Wright, Peter ","cat":"","pri":"16,9 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Wright, Peter <\/a>","confirmed_b":1},{"id":"6803","tem":"153","ctr":"217","nam":"Gurney, Daryl ","namorig":"Gurney, Daryl ","cat":"","pri":"10,1 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Gurney, Daryl <\/a>","confirmed_b":1},{"id":"4955","tem":"153","ctr":"214","nam":"Smith, Michael ","namorig":"Smith, Michael ","cat":"","pri":"8,9 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Smith, Michael <\/a>","confirmed_b":1},{"id":"4899","tem":"153","ctr":"51","nam":"Whitlock, Simon ","namorig":"Whitlock, Simon ","cat":"","pri":"8,7 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Whitlock, Simon <\/a>","confirmed_b":1},{"id":"4933","tem":"153","ctr":"214","nam":"Chisnall, Dave ","namorig":"Chisnall, Dave ","cat":"","pri":"7,8 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Chisnall, Dave <\/a>","confirmed_b":1},{"id":"15735","tem":"153","ctr":"214","nam":"Cross, Rob ","namorig":"Cross, Rob ","cat":"","pri":"7,5 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Cross, Rob <\/a>","confirmed_b":1},{"id":"4946","tem":"153","ctr":"214","nam":"Cullen, Joe ","namorig":"Cullen, Joe ","cat":"","pri":"7,3 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Cullen, Joe <\/a>","confirmed_b":1},{"id":"4927","tem":"153","ctr":"61","nam":"Klaasen, Jelle ","namorig":"Klaasen, Jelle ","cat":"","pri":"6,9 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Klaasen, Jelle <\/a>","confirmed_b":1},{"id":"5172","tem":"153","ctr":"61","nam":"Pas, Benito van de","namorig":"Pas, Benito van de","cat":"","pri":"6,7 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Pas, Benito van de<\/a>","confirmed_b":1},{"id":"4897","tem":"153","ctr":"214","nam":"Wade, James ","namorig":"Wade, James ","cat":"","pri":"6,2 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Wade, James <\/a>","confirmed_b":1},{"id":"5158","tem":"153","ctr":"214","nam":"Norris, Alan ","namorig":"Norris, Alan ","cat":"","pri":"6,1 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Norris, Alan <\/a>","confirmed_b":1},{"id":"4964","tem":"153","ctr":"76","nam":"Huybrechts, Kim ","namorig":"Huybrechts, Kim ","cat":"","pri":"5,8 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Huybrechts, Kim <\/a>","confirmed_b":1},{"id":"4960","tem":"153","ctr":"214","nam":"White, Ian ","namorig":"White, Ian ","cat":"","pri":"5,4 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"White, Ian <\/a>","confirmed_b":1},{"id":"4905","tem":"153","ctr":"214","nam":"King, Mervyn ","namorig":"King, Mervyn ","cat":"","pri":"5 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"King, Mervyn <\/a>","confirmed_b":1},{"id":"10058","tem":"153","ctr":"216","nam":"Price, Gerwyn ","namorig":"Price, Gerwyn ","cat":"","pri":"4,5 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Price, Gerwyn <\/a>","confirmed_b":1},{"id":"4924","tem":"153","ctr":"215","nam":"Thornton, Robert ","namorig":"Thornton, Robert ","cat":"","pri":"4,3 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Thornton, Robert <\/a>","confirmed_b":1},{"id":"4910","tem":"153","ctr":"61","nam":"Voort, Vincent van der","namorig":"Voort, Vincent van der","cat":"","pri":"3,7 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Voort, Vincent van der<\/a>","confirmed_b":1},{"id":"5157","tem":"153","ctr":"214","nam":"West, Steve ","namorig":"West, Steve ","cat":"","pri":"3,4 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"West, Steve <\/a>","confirmed_b":1},{"id":"5164","tem":"153","ctr":"214","nam":"Bunting, Stephen ","namorig":"Bunting, Stephen ","cat":"","pri":"3,2 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Bunting, Stephen <\/a>","confirmed_b":1},{"id":"13607","tem":"153","ctr":"33","nam":"Ratajski, Krzysztof ","namorig":"Ratajski, Krzysztof ","cat":"","pri":"3,1 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Ratajski, Krzysztof <\/a>","confirmed_b":1},{"id":"5179","tem":"153","ctr":"61","nam":"Kist, Christian ","namorig":"Kist, Christian ","cat":"","pri":"3 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Kist, Christian <\/a>","confirmed_b":1},{"id":"6451","tem":"153","ctr":"214","nam":"Wilson, James ","namorig":"Wilson, James ","cat":"","pri":"2,9 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Wilson, James <\/a>","confirmed_b":1},{"id":"10185","tem":"153","ctr":"76","nam":"Bergh, Dimitri Van den","namorig":"Bergh, Dimitri Van den","cat":"","pri":"2,8 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Bergh, Dimitri Van den<\/a>","confirmed_b":1},{"id":"10310","tem":"153","ctr":"214","nam":"Dobey, Chris ","namorig":"Dobey, Chris ","cat":"","pri":"2,7 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Dobey, Chris <\/a>","confirmed_b":1},{"id":"4912","tem":"153","ctr":"214","nam":"Caven, Jamie ","namorig":"Caven, Jamie ","cat":"","pri":"2,6 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Caven, Jamie <\/a>","confirmed_b":1},{"id":"5169","tem":"153","ctr":"61","nam":"Dekker, Jan ","namorig":"Dekker, Jan ","cat":"","pri":"2,5 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Dekker, Jan <\/a>","confirmed_b":1},{"id":"11539","tem":"153","ctr":"61","nam":"Wattimena, Jermaine ","namorig":"Wattimena, Jermaine ","cat":"","pri":"2,4 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Wattimena, Jermaine <\/a>","confirmed_b":1},{"id":"11873","tem":"153","ctr":"216","nam":"Clayton, Jonny ","namorig":"Clayton, Jonny ","cat":"","pri":"2,2 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Clayton, Jonny <\/a>","confirmed_b":1},{"id":"7381","tem":"153","ctr":"214","nam":"Brown, Keegan ","namorig":"Brown, Keegan ","cat":"","pri":"2,1 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Brown, Keegan <\/a>","confirmed_b":1},{"id":"7406","tem":"153","ctr":"214","nam":"Evans, Ricky ","namorig":"Evans, Ricky ","cat":"","pri":"2 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Evans, Ricky <\/a>","confirmed_b":1},{"id":"4980","tem":"153","ctr":"214","nam":"Richardson, James ","namorig":"Richardson, James ","cat":"","pri":"2 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Richardson, James <\/a>","confirmed_b":1},{"id":"8299","tem":"153","ctr":"61","nam":"Zwaan, Jeffrey de","namorig":"Zwaan, Jeffrey de","cat":"","pri":"1,9 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Zwaan, Jeffrey de<\/a>","confirmed_b":1},{"id":"11874","tem":"153","ctr":"214","nam":"Aspinall, Nathan ","namorig":"Aspinall, Nathan ","cat":"","pri":"1,8 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Aspinall, Nathan <\/a>","confirmed_b":1},{"id":"5168","tem":"153","ctr":"215","nam":"Boulton, Andy ","namorig":"Boulton, Andy ","cat":"","pri":"1,6 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Boulton, Andy <\/a>","confirmed_b":1},{"id":"8577","tem":"153","ctr":"61","nam":"Meeuwisse, Yordi ","namorig":"Meeuwisse, Yordi ","cat":"","pri":"1,5 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Meeuwisse, Yordi <\/a>","confirmed_b":1},{"id":"10694","tem":"153","ctr":"14","nam":"Schindler, Martin ","namorig":"Schindler, Martin ","cat":"","pri":"1,5 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Schindler, Martin <\/a>","confirmed_b":1},{"id":"18095","tem":"153","ctr":"14","nam":"Blum, Nico ","namorig":"Blum, Nico ","cat":"","pri":"1,4 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Blum, Nico <\/a>","confirmed_b":1},{"id":"9068","tem":"153","ctr":"93","nam":"Lerchbacher, Zoran ","namorig":"Lerchbacher, Zoran ","cat":"","pri":"1,4 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Lerchbacher, Zoran <\/a>","confirmed_b":1},{"id":"8304","tem":"153","ctr":"142","nam":"Razma, Madars ","namorig":"Razma, Madars ","cat":"","pri":"1,3 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Razma, Madars <\/a>","confirmed_b":1},{"id":"16506","tem":"153","ctr":"14","nam":"Allenstein, Robert ","namorig":"Allenstein, Robert ","cat":"","pri":"1,2 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Allenstein, Robert <\/a>","confirmed_b":1},{"id":"6904","tem":"153","ctr":"214","nam":"Bowles, John ","namorig":"Bowles, John ","cat":"","pri":"1,2 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Bowles, John <\/a>","confirmed_b":1},{"id":"8296","tem":"153","ctr":"14","nam":"Eidams, Rene ","namorig":"Eidams, Rene ","cat":"","pri":"1,2 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Eidams, Rene <\/a>","confirmed_b":1},{"id":"17495","tem":"153","ctr":"214","nam":"Quantock, Chris ","namorig":"Quantock, Chris ","cat":"","pri":"1,2 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Quantock, Chris <\/a>","confirmed_b":1},{"id":"5003","tem":"153","ctr":"214","nam":"Todd, Mick ","namorig":"Todd, Mick ","cat":"","pri":"1,1 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Todd, Mick <\/a>","confirmed_b":1},{"id":"10297","tem":"153","ctr":"216","nam":"Worsley, Jon ","namorig":"Worsley, Jon ","cat":"","pri":"1,1 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Worsley, Jon <\/a>","confirmed_b":1},{"id":"18833","tem":"153","ctr":"14","nam":"Bilderl, Manfred ","namorig":"Bilderl, Manfred ","cat":"","pri":"1 \u043c\u043b\u043d.","rat":0,"mw":"\u041c","link":"Bilderl, Manfred <\/a>","confirmed_b":1}]; var sportsmenTeams = []; var showTeams = 0; //*********************** //SPORTSMEN TABLE HEADERS //*********************** var headersTableSportsmen = [ { 'sTitle': '№.' }, { 'sTitle': 'Группа' , 'bSearchable': false, 'bVisible': false }, { 'sTitle': 'Страна', 'sSortDataType': 'sortCountryFlag', sType : "text" }, { 'sTitle': 'игрок в дартс'}, { 'sTitle': 'Стоимость', 'sSortDataType': 'sortMln', 'sType': 'numeric' }, { 'sTitle': 'Команда' , 'bSearchable': false, 'bVisible': false }, { 'sTitle': 'М/Ж' , 'bSearchable': false, 'bVisible': false } ]; //*********************** //TEAMS TABLE HEADERS //*********************** var headersTableTeams = [ {'sTitle': '№.'}, {'sTitle': '' , 'bSearchable': false, 'bVisible': false }, {'sTitle': 'Страна' , 'sSortDataType': 'sortCountryFlag', sType : 'text' }, { 'sTitle': ''}, { 'sTitle': 'Стоимость', 'sSortDataType': 'sortMln', 'sType': 'numeric' } ]; //*********************** //SPORTSMEN TABLE CONTENT //*********************** var contentTableSportsmen = []; $.each(sportsmen, function(k, v) { contentTableSportsmen.push([ k + 1, v['cat'], getFlag(v['ctr']), v['link'], v['pri'], isset(teams[v['tem']])? teams[v['tem']]['name']:'', v['mw'] ]); }); //*********************** //TEAMS TABLE CONTENT //*********************** var contentTableTeams = []; $.each(sportsmenTeams, function(k, v) { contentTableTeams.push([ k + 1, "", getFlag(v['ctr']), v['nam'], v['pri'] ]); }); function isset (va) { return typeof va != 'undefined'; } $(document).ready(function() { $.fn.dataTable.ext.order['sortMln'] = function (settings, col) { return this.api().column(col, {order: 'index'}).nodes().map(function (td) { return parseFloat($(td).text().replace(' млн.', '').replace(',', '.')); } ); }; if (sportsmen.length) { var sportsmenTable = $('#tblSportsmen').dataTable( { "bPaginate": false, "bFilter": true, "bInfo": false, "bAutoWidth": true, "aoColumns" : headersTableSportsmen, "aaData": contentTableSportsmen, "bAutoWidth": false } ); } if (sportsmenTeams.length) { var sportsmenTeamsTable = $('#tblTeams').dataTable( { "bPaginate": false, "bFilter": true, "bInfo": false, "bAutoWidth": true, "aoColumns" : headersTableTeams, "aaData": contentTableTeams, "bAutoWidth": false } ); $('#teamsOverview').show(); } } ); function getFlag(id, margin) { if (!id || typeof countries[id] === "undefined" ) return ""; if (typeof margin == 'undefined') margin = true; return ""; }