return;
StringBuilder borderStyle = new StringBuilder();
- borderStyle.append( ExcelToHtmlUtils.getBorderStyle( xlsBorder ) );
- borderStyle.append( ' ' );
borderStyle.append( ExcelToHtmlUtils.getBorderWidth( xlsBorder ) );
+ borderStyle.append( ' ' );
+ borderStyle.append( ExcelToHtmlUtils.getBorderStyle( xlsBorder ) );
final HSSFColor color = workbook.getCustomPalette().getColor(
borderColor );
borderStyle.append( ExcelToHtmlUtils.getColor( color ) );
}
- style.append( type + "-border: " + borderStyle + "; " );
+ style.append( "border-" + type + ": " + borderStyle + "; " );
}
void buildStyle_font( HSSFWorkbook workbook, StringBuilder style,
return;
Element table = htmlDocumentFacade.createTable();
+ table.setAttribute( "class", "t" );
+
Element tableBody = htmlDocumentFacade.createTableBody();
final List<Element> emptyRowElements = new ArrayList<Element>(
processSheet( workbook, sheet );
}
+ stylesElement
+ .appendChild( htmlDocumentFacade
+ .createText( "table.t{border-collapse:collapse;border-spacing:0;}\n" ) );
if ( !cssStyleToClass.isEmpty() )
{
for ( Map.Entry<String, String> entry : cssStyleToClass.entrySet() )
public static String getColor( HSSFColor color )
{
- StringBuilder stringBuilder = new StringBuilder();
+ StringBuilder stringBuilder = new StringBuilder( 7 );
+ stringBuilder.append( '#' );
for ( short s : color.getTriplet() )
{
if ( s < 10 )
stringBuilder.append( Integer.toHexString( s ) );
}
- return stringBuilder.toString();
+ String result = stringBuilder.toString();
+
+ if ( result.equals( "#ffffff" ) )
+ return "white";
+
+ if ( result.equals( "#c0c0c0" ) )
+ return "silver";
+
+ if ( result.equals( "#808080" ) )
+ return "gray";
+
+ if ( result.equals( "#000000" ) )
+ return "black";
+
+ return result;
}
/**