我搜索了一段时间,请原谅我是否已有答案。我在使用CFSpreadsheet将边框应用于合并单元格时遇到麻烦。以下是一些示例代码。
<cfscript>
newSS = SpreadsheetNew('Testing'); //Create Spreadsheet
SpreadsheetMergeCells(newSS,1,1,1,9);
SpreadsheetAddRow(newSS,'Underline this Header');
SpreadSheetFormatCell(newSS,{bold=true,alignment='center',bottomborder='thin'},1,1);
Spreadsheetwrite(newSS,expandpath('myTest.xls'),true); //Write File
</cfscript>
我期望的是贯穿整个单元格的最下面的单元格。我得到的是顶部单元格仅在列“ A”下带下划线,之后没有下划线。无论如何还是这只是CFSpreadsheet的限制?
谢谢!
根据POI常见问题解答,即基础库CF用于生成电子表格,目前不支持此功能(重点是我的):
12.如何在合并的单元格周围添加边框?
在通常要放置单元格的位置周围添加空白单元格,并分别为每个单元格设置边框。将来我们可能会增强HSSF,以使此过程更加容易。
您现在可能要做的最好的事情是使用SpreadsheetFormatCellRange而不是SpreadSheetFormatCell:
SpreadsheetFormatCellRange ( newSS
, {bold=true,alignment='center',bottomborder='thin'}
, 1,1,1,9 );
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句