rainabba / jquery-table2excel

jQuery Plugin to export HTML tabled to Excel Spreadsheet Compatible Files
591 stars 667 forks source link

scientific notation #79

Open luolei100 opened 7 years ago

luolei100 commented 7 years ago

how can i set the cell data style . not 123.456E+12

luolei100 commented 7 years ago

$nbsp;

rainabba commented 7 years ago

There's not really any style support at this point. XLSX does allow for styling though and I definitely welcome a PR to add that features.

I suggest using Google Sheets to "export" an XLSX with a bold cell and a cell with content not bolded. Then export another one with no bolded content at all (to see if you need to include style markup to be able to add a "bold" style to a cell AND see how).

I'll try to get to this myself in a couple days if nobody gets a PR to me or declares their intention more quickly.

xiayin1992728 commented 6 years ago

mid: "/x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--><style>.format{mso-number-format:'\\@';}</style",

$(this).find("td").each(function() { if(!$(this).is(".noExl")){ tempColum += "" +$(this).html()+ ""; } });

xiayin1992728 commented 6 years ago

tempColum += "" +$(this).html()+ "";

xiayin1992728 commented 6 years ago

tempColum +=

""
+$(this).html()+ "";

xiayin1992728 commented 6 years ago

tempColum += "" +$(this).html()+ "";

xiayin1992728 commented 6 years ago

``tempColum += "" +$(this).html()+ "";

xiayin1992728 commented 6 years ago

tempColum += "<td class='format'>" +$(this).html()+ "</td>";

Zephyr-co commented 4 years ago
if (additionalStyles) {
                            tempRows += "style= mso-number-format:\"\@\";"
                                + additionalStyles + "'";
                        } else {
                            tempRows += " style= mso-number-format:\"\@\";"
                        }

you can set style,i set style defult text;