简体   繁体   中英

how to convert the width of column of html table to the width of excel column in java

I have width of the column value as a percentage and I want to convert the same to excel width to set the width of the column. How do we do this in java, based on what the column width is calculated in excel.?

I use the following:

HSSFSheet sheet = hwb.createSheet(reportName); 
sheet.setColumnWidth((short)columnIterator, (short)6000);

In this method, the first argument is the column id and the second one is the width of the column. I want to set this width dynamically using the html width.

Example:

If the the column width in html is 10% then what is the equelant width in excel width.? I want to set the column width of excel dynamically like setAutoColumnwidth().

UPDATE :

i found this , is this correct.

Regards,

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM