short[] rgb = color.getTriplet();
css(td,"background-color",String.format("#%02x%02x%02x", rgb[0],rgb[1],rgb[2]));
}
HSSFFont font = style.getFont(book);
if(font!=null){
css(td,"font-family",font.getFontName());
colorIndex = font.getColor();
color = palette.getColor(colorIndex);
if(color!=null){
// if(colorIndex!=HSSF_AUTO.getIndex()&&color!=null){
short[] rgb = color.getTriplet();
css(td,"color",String.format("#%02x%02x%02x", rgb[0],rgb[1],rgb[2]));
}
css(td,"font-size",String.format("%dpx",pointsToPixels(font.getFontHeightInPoints())));
// 20111024 对于
// 1 styleLeft
// 2 styleCenter
// 3 styleRight
// 和
// 4 styleTop
// 5 styleMiddle
// 6 styleBottom 需要设置对应的td的valign和align属性
// 7 styleBold
// 8 styleItalics
// 9 styleUnderline
// 10 styleLineThrough
if(HSSFFont.BOLDWEIGHT_BOLD==font.getBoldweight()){
classes(td,"styleBold");
}
if(font.getItalic()){
classes(td,"styleItalics");
}
switch(font.getUnderline()){
case HSSFFont.U_DOUBLE:
case HSSFFont.U_DOUBLE_ACCOUNTING:
case HSSFFont.U_SINGLE:
case HSSFFont.U_SINGLE_ACCOUNTING:
classes(td,"styleUnderline");
}
if(font.getStrikeout()){
classes(td,"styleLineThrough");
}
}
switch(style.getAlignment()){