Open kingzez opened 7 years ago
Okey!
Search;
console.log(tempRows);
Add before
tempRows = $(o).html();
border and other style items are working!
Enjoy
$(p).find("td,th").not(e.settings.exclude).each(function (i,q) {
additionalStyles = "";
if(e.settings.preserveColors){
compStyle = getComputedStyle(q);
additionalStyles += (compStyle && compStyle.backgroundColor ? "background-color: " + compStyle.backgroundColor + ";" : "");
additionalStyles += (compStyle && compStyle.color ? "color: " + compStyle.color + ";" : "");
//I added this line below, and it shows border in Excel. 1px border in Excel is too thick so I replaced it with 0.3pt.
additionalStyles+=(compStyle&&compStyle.border?"border: "+compStyle.border.replace("1px",".3pt")+";":"");
}
var rc = {
rows: $(this).attr("rowspan"),
cols: $(this).attr("colspan"),
flag: $(q).find(e.settings.exclude)
};
if( rc.flag.length > 0 ) {
tempRows += "<td> </td>";
} else {
tempRows += "<td";
if( rc.rows > 0) {
tempRows += " rowspan='" + rc.rows + "' ";
}
if( rc.cols > 0) {
tempRows += " colspan='" + rc.cols + "' ";
}
if(additionalStyles){
tempRows += " style='" + additionalStyles + "'";
}
tempRows += ">" + $(q).html() + "</td>";
}
});
the export excel file's content has no border