jQuery Tablesorter - 导出日期而不是浮点数

jQuery Tablesorter - exports dates instead of floats

DEMO

当我将 table 导出到 csv 时,浮点数用小数点“.”分隔。 在 excel 中,值被转换为日期,而不是像在 HTML table.

中那样保留它们

有没有办法用小数点逗号","代替点""

$(function () {

    var $table = $('table');

    $('.download').click(function(){
        $table.trigger('outputTable');
    });

    $table.tablesorter({
        theme: 'blue',
        widgets: ['zebra', 'output'],
        widgetOptions : { output_delivery : 'd', output_separator     : ';'}
    });
});

您可以配置一个 output_formatContent,像这样:

$(function() {
  var $table = $('table');

  $('.download').click(function() {
    $table.trigger('outputTable');
  });

  $table.tablesorter({
    theme: 'blue',
    widgets: ['zebra', 'output'],
    widgetOptions: {
      output_delivery: 'd',
      output_separator: ';',
      output_formatContent: function(c, wo, data) {
        if (c.parsers[data.$cell['0'].cellIndex].type !== 'numeric')
          return data.content;
        return data.content.replace(/\./ig, ',');
      }
    }
  });
});

您可以在这里查看:http://jsfiddle.net/abkNM/8781/