}
XSSFColor color = null;
color = style.getTopBorderXSSFColor();
if(color!=null){
CTColor ctColor = color.getCTColor();
if(ctColor!=null){
if(ctColor.isSetRgb()){
byte[] rgb = ctColor.getRgb();
if(rgb.length==3){
css(td,"border-top-color",String.format("#%02x%02x%02x", rgb[0],rgb[1],rgb[2]));
}else if(rgb.length==4){
css(td,"border-top-color",String.format("#%02x%02x%02x", rgb[1],rgb[2],rgb[3]));
}
}else{
css(td,"border-top-color","#000000");
}
}else{
css(td,"border-top-color","#000000");
}
}
switch(style.getBorderBottom()){
case CellStyle.BORDER_THICK:
case CellStyle.BORDER_MEDIUM:
case CellStyle.BORDER_THIN:
css(td,"border-bottom-style","solid");
break;
case CellStyle.BORDER_DASH_DOT:
case CellStyle.BORDER_DASH_DOT_DOT:
case CellStyle.BORDER_DASHED:
css(td,"border-bottom-style","dashed");
break;
case CellStyle.BORDER_DOTTED:
case CellStyle.BORDER_DOUBLE:
case CellStyle.BORDER_HAIR:
case CellStyle.BORDER_MEDIUM_DASH_DOT:
case CellStyle.BORDER_MEDIUM_DASH_DOT_DOT:
case CellStyle.BORDER_MEDIUM_DASHED:
case CellStyle.BORDER_SLANTED_DASH_DOT:
css(td,"border-bottom-style","dotted");
break;
}
color = style.getBottomBorderXSSFColor();
if(color!=null){
CTColor ctColor = color.getCTColor();
if(ctColor!=null){
if(ctColor.isSetRgb()){
byte[] rgb = ctColor.getRgb();
if(rgb.length==3){
css(td,"border-bottom-color",String.format("#%02x%02x%02x", rgb[0],rgb[1],rgb[2]));
}else if(rgb.length==4){
css(td,"border-bottom-color",String.format("#%02x%02x%02x", rgb[1],rgb[2],rgb[3]));
}
}else{
css(td,"border-bottom-color","#000000");
}
}else{
css(td,"border-bottom-color","#000000");
}
}
switch(style.getBorderLeft()){
case CellStyle.BORDER_THICK:
case CellStyle.BORDER_MEDIUM:
case CellStyle.BORDER_THIN:
css(td,"border-left-style","solid");
break;
case CellStyle.BORDER_DASH_DOT:
case CellStyle.BORDER_DASH_DOT_DOT:
case CellStyle.BORDER_DASHED:
css(td,"border-left-style","dashed");
break;
case CellStyle.BORDER_DOTTED:
case CellStyle.BORDER_DOUBLE:
case CellStyle.BORDER_HAIR:
case CellStyle.BORDER_MEDIUM_DASH_DOT:
case CellStyle.BORDER_MEDIUM_DASH_DOT_DOT:
case CellStyle.BORDER_MEDIUM_DASHED:
case CellStyle.BORDER_SLANTED_DASH_DOT:
css(td,"border-left-style","dotted");
break;
}
color = style.getLeftBorderXSSFColor();
if(color!=null){
CTColor ctColor = color.getCTColor();
if(ctColor!=null){
if(ctColor.isSetRgb()){
byte[] rgb = ctColor.getRgb();
if(rgb.length==3){
css(td,"border-left-color",String.format("#%02x%02x%02x", rgb[0],rgb[1],rgb[2]));
}else if(rgb.length==4){
css(td,"border-left-color",String.format("#%02x%02x%02x", rgb[1],rgb[2],rgb[3]));
}
}else{
css(td,"border-left-color","#000000");
}
}else{
css(td,"border-left-color","#000000");
}
}
switch(style.getBorderRight()){
case CellStyle.BORDER_THICK:
case CellStyle.BORDER_MEDIUM:
case CellStyle.BORDER_THIN:
css(td,"border-right-style","solid");
break;
case CellStyle.BORDER_DASH_DOT:
case CellStyle.BORDER_DASH_DOT_DOT:
case CellStyle.BORDER_DASHED:
css(td,"border-right-style","dashed");
break;
case CellStyle.BORDER_DOTTED:
case CellStyle.BORDER_DOUBLE:
case CellStyle.BORDER_HAIR:
case CellStyle.BORDER_MEDIUM_DASH_DOT:
case CellStyle.BORDER_MEDIUM_DASH_DOT_DOT:
case CellStyle.BORDER_MEDIUM_DASHED:
case CellStyle.BORDER_SLANTED_DASH_DOT:
css(td,"border-right-style","dotted");
break;
}
color = style.getRightBorderXSSFColor();
if(color!=null){
CTColor ctColor = color.getCTColor();
if(ctColor!=null){
if(ctColor.isSetRgb()){
byte[] rgb = ctColor.getRgb();
if(rgb.length==3){
css(td,"border-right-color",String.format("#%02x%02x%02x", rgb[0],rgb[1],rgb[2]));
}else if(rgb.length==4){
css(td,"border-right-color",String.format("#%02x%02x%02x", rgb[1],rgb[2],rgb[3]));
}
}else{
css(td,"border-right-color","#000000");
}
}else{
css(td,"border-right-color","#000000");
}
}
// color = style.getFillForegroundXSSFColor();
// if(color!=null){
// CTColor ctColor = color.getCTColor();
// if(ctColor!=null){
// if(ctColor.isSetRgb()){
// byte[] rgb = ctColor.getRgb();
// if(rgb.length==3){
// css(td,"background-color",String.format("#%02x%02x%02x", rgb[0],rgb[1],rgb[2]));
// }else if(rgb.length==4){
// css(td,"background-color",String.format("#%02x%02x%02x", rgb[1],rgb[2],rgb[3]));
// }
// }else{
// css(td,"background-color","#ffffff");
// }
// }else{
// css(td,"background-color","#ffffff");
// }
// }
color = style.getFillBackgroundXSSFColor();
if(color!=null){
CTColor ctColor = color.getCTColor();
if(ctColor!=null){
if(ctColor.isSetRgb()){
byte[] rgb = ctColor.getRgb();
if(rgb.length==3){
css(td,"background-color",String.format("#%02x%02x%02x", rgb[0],rgb[1],rgb[2]));
}else if(rgb.length==4){
css(td,"background-color",String.format("#%02x%02x%02x", rgb[1],rgb[2],rgb[3]));
}
}else{
css(td,"background-color","#ffffff");
}
}else{
css(td,"background-color","#ffffff");
}
}
XSSFFont font = style.getFont();
if(font!=null){
css(td,"font-family",font.getFontName());
color = font.getXSSFColor();
if(color!=null){
CTColor ctColor = color.getCTColor();
if(ctColor!=null){
if(ctColor.isSetRgb()){
byte[] rgb = ctColor.getRgb();
if(rgb.length==3){
if(rgb[0]==-1&&rgb[1]==-1&&rgb[2]==-1){
css(td,"color","#000000");
}else{
css(td,"color",String.format("#%02x%02x%02x", rgb[0],rgb[1],rgb[2]));