📄 cells.html
字号:
</DL>
<HR>
<A NAME="getRows()"><!-- --></A><H3>
getRows</H3>
<PRE>
public <A HREF="../../../../application/workbooks/workbook/tables/Rows.html" title="application.workbooks.workbook.tables 中的类">Rows</A> <B>getRows</B>()</PRE>
<DL>
<DD>获得当前单元格区域所在的行集合。
<P>
<DD><DL>
<DT><B>返回:</B><DD>单元格区域的行集合对象 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); TextRange range = doc.getRange(0); Tables tables = doc.getTables(); Table table = tables.addTable(range, 5, 5); Cells cells = table.getSelectingCells(); application.workbooks.workbook.tables.Rows rows = cells.getRows(); System.out.println("当前选中的单元格区域的行数为" + rows.getCount()); </pre></DL>
</DD>
</DL>
<HR>
<A NAME="getShadingAttribute()"><!-- --></A><H3>
getShadingAttribute</H3>
<PRE>
public <A HREF="../../../../application/workbooks/workbook/style/border/ShadingAttribute.html" title="application.workbooks.workbook.style.border 中的类">ShadingAttribute</A> <B>getShadingAttribute</B>()</PRE>
<DL>
<DD>得到指定单元格区域的底纹属性。
<P>
<DD><DL>
<DT><B>返回:</B><DD>单元格的底纹属性 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); TextRange range = doc.getRange(0); Tables tables = doc.getTables(); Table table = tables.addTable(range, 5, 5); Cells cells = table.getSelectionCells(); ShadingAttribute shadingAttribute = cells.getShadingAttribute(); System.out.println("返回单元格区域的底纹图案索引:"+ shadingAttribute.getTextureIndex()); </pre><DT><B>另请参见:</B><DD><A HREF="../../../../application/workbooks/workbook/tables/Cells.html#setShadingAttribute(application.workbooks.workbook.style.border.ShadingAttribute)"><CODE>setShadingAttribute(ShadingAttribute)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="merge()"><!-- --></A><H3>
merge</H3>
<PRE>
public <A HREF="../../../../application/workbooks/workbook/tables/Cell.html" title="application.workbooks.workbook.tables 中的类">Cell</A> <B>merge</B>()</PRE>
<DL>
<DD>将指定的单元格区域合并成一个单元格对象。
<P>
<DD><DL>
<DT><B>返回:</B><DD>合并后的单元格对象 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); TextRange range = doc.getRange(0); Tables tables = doc.getTables(); Table table = tables.addTable(range, 5, 5); application.workbooks.workbook.tables.Rows rows = table.getRows(); Row row = rows.getRow(2); Cells cells = row.getCells(); application.workbooks.workbook.tables.Cell mergeCell = cells.merge(); mergeCell.getRange().insertText("永中OFFICE");
<DT><B>抛出:</B>
<DD><CODE><A HREF="../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 当前单元格集合不是一个规则区域,不能进行合并单元格操作<DT><B>另请参见:</B><DD><A HREF="../../../../application/workbooks/workbook/tables/Cells.html#split(int, int, boolean)"><CODE>split(int, int, boolean)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="setBorderAttribute(application.workbooks.workbook.style.border.BorderAttribute)"><!-- --></A><H3>
setBorderAttribute</H3>
<PRE>
public void <B>setBorderAttribute</B>(<A HREF="../../../../application/workbooks/workbook/style/border/BorderAttribute.html" title="application.workbooks.workbook.style.border 中的类">BorderAttribute</A> borderAttribute)</PRE>
<DL>
<DD>设置指定单元格区域的边框属性。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>borderAttribute</CODE> - 单元格的边框属性 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); TextRange range = doc.getRange(0); Tables tables = doc.getTables(); Table table = tables.addTable(range, 5, 5); Cells cells = table.getSelectionCells(); BorderAttribute borderAttribute = cells.getBorderAttribute(); borderAttribute.setBorderType(BorderAndShadingConstants.BORDERTYPE_BOX); borderAttribute.setBorderLineType(BorderAndShadingConstants.TOP,1); borderAttribute.setBorderLineType(BorderAndShadingConstants.LEFT,3); borderAttribute.setBorderLineType(BorderAndShadingConstants.RIGHT,6); borderAttribute.setBorderLineType(BorderAndShadingConstants.BOTTOM,8); borderAttribute.setBorderLineColor(BorderAndShadingConstants.TOP,Color.RED); borderAttribute.setBorderLineColor(BorderAndShadingConstants.LEFT,Color.CYAN); borderAttribute.setBorderLineColor(BorderAndShadingConstants.RIGHT,Color.YELLOW); borderAttribute.setBorderLineColor(BorderAndShadingConstants.BOTTOM,Color.ORANGE); borderAttribute.setBorderLineWidth(BorderAndShadingConstants.TOP,8f); borderAttribute.setBorderLineWidth(BorderAndShadingConstants.LEFT,5f); borderAttribute.setBorderLineWidth(BorderAndShadingConstants.RIGHT,3f); borderAttribute.setBorderLineWidth(BorderAndShadingConstants.BOTTOM,1f); cells.setBorderAttribute(borderAttribute); </pre>
<DT><B>抛出:</B>
<DD><CODE><A HREF="../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 当参数为NULL<DT><B>另请参见:</B><DD><A HREF="../../../../application/workbooks/workbook/tables/Cells.html#getBorderAttribute()"><CODE>getBorderAttribute()</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="setCellAttribute(application.workbooks.workbook.tables.CellAttribute)"><!-- --></A><H3>
setCellAttribute</H3>
<PRE>
public void <B>setCellAttribute</B>(<A HREF="../../../../application/workbooks/workbook/tables/CellAttribute.html" title="application.workbooks.workbook.tables 中的类">CellAttribute</A> cellAttribute)</PRE>
<DL>
<DD>设置指定单元格区域的单元格属性。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>cellAttribute</CODE> - 单元格属性 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); TextRange range = doc.getRange(0); Tables tables = doc.getTables(); Table table = tables.addTable(range, 5, 5); application.workbooks.workbook.tables.Rows rows = table.getRows(); Row row = rows.getRow(2); Cells cells = row.getCells(); CellAttribute cellAttribute = cells.getCellAttribute(); cellAttribute.setPreferredWidthMeasure(TableConstants.CELL_WIDTH_MEASURE); cellAttribute.setPreferredWidth(40.0f); cells.setCellAttribute(cellAttribute); </pre>
<DT><B>抛出:</B>
<DD><CODE><A HREF="../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 当参数为空<DT><B>另请参见:</B><DD><A HREF="../../../../application/workbooks/workbook/tables/Cells.html#getCellAttribute()"><CODE>getCellAttribute()</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="setShadingAttribute(application.workbooks.workbook.style.border.ShadingAttribute)"><!-- --></A><H3>
setShadingAttribute</H3>
<PRE>
public void <B>setShadingAttribute</B>(<A HREF="../../../../application/workbooks/workbook/style/border/ShadingAttribute.html" title="application.workbooks.workbook.style.border 中的类">ShadingAttribute</A> shadingAttribute)</PRE>
<DL>
<DD>设置指定单元格区域的底纹属性。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>shadingAttribute</CODE> - 单元格的底纹属性 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); TextRange range = doc.getRange(0); Tables tables = doc.getTables(); Table table = tables.addTable(range, 5, 5); Cells cells = table.getSelectionCells(); ShadingAttribute shadingAttribute = cells.getShadingAttribute(); shadingAttribute.setTextureIndex(10); cells.setShadingAttribute(shadingAttribute); </pre>
<DT><B>抛出:</B>
<DD><CODE><A HREF="../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 当参数为NULL<DT><B>另请参见:</B><DD><A HREF="../../../../application/workbooks/workbook/tables/Cells.html#getShadingAttribute()"><CODE>getShadingAttribute()</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="split(int, int, boolean)"><!-- --></A><H3>
split</H3>
<PRE>
public void <B>split</B>(int row,
int column,
boolean isMerge)</PRE>
<DL>
<DD>拆分表格单元格范围。如果对多个连续单元格组成的区域进行拆分时,可以先合并此范围再拆分,或对每个单元格进行相同的拆分。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>row</CODE> - 拆分的行数<DD><CODE>column</CODE> - 拆分的列数<DD><CODE>isMerge</CODE> - 是否要先合并单元格再进行拆分 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); TextRange range = doc.getRange(0); Tables tables = doc.getTables(); Table table = tables.addTable(range, 5, 5); application.workbooks.workbook.tables.Rows rows = table.getRows(); Row row = rows.getRow(2); Cells cells = row.getCells(); cells.split(2, 2, true);
<DT><B>抛出:</B>
<DD><CODE><A HREF="../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 当前单元格集合不是一个规则区域,不能进行合并单元格操作<DT><B>另请参见:</B><DD><A HREF="../../../../application/workbooks/workbook/tables/Cells.html#merge()"><CODE>merge()</CODE></A></DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="跳过导航链接"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>概述</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>软件包</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>类</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>树</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>索引</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>帮助</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../application/workbooks/workbook/tables/CellAttribute.html" title="application.workbooks.workbook.tables 中的类"><B>上一个类</B></A>
<A HREF="../../../../application/workbooks/workbook/tables/Column.html" title="application.workbooks.workbook.tables 中的类"><B>下一个类</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?application/workbooks/workbook/tables/Cells.html" target="_top"><B>框架</B></A>
<A HREF="Cells.html" target="_top"><B>无框架</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>所有类</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../allclasses-noframe.html"><B>所有类</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
摘要: 嵌套 | 字段 | 构造方法 | <A HREF="#method_summary">方法</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
详细信息: 字段 | 构造方法 | <A HREF="#method_detail">方法</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
版权所有 2001-2006 无锡永中科技有限公司
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -