⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tableattribute.html

📁 永中OFFICE二次开发帮助文档
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<DT><B>返回:</B><DD>float  表格距正文上的间距 <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); TableAttribute tableAttribute = table.getTableAttribute(); System.out.println("正文文本与表格之间的上边距为:"+ tableAttribute.getTopDistance()); </pre><DT><B>另请参见:</B><DD><A HREF="../../../../application/workbooks/workbook/tables/TableAttribute.html#setTopDistance(float)"><CODE>setTopDistance(float)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getVerticalPosition()"><!-- --></A><H3>
getVerticalPosition</H3>
<PRE>
public int <B>getVerticalPosition</B>()</PRE>
<DL>
<DD>得到表格定位的垂直位置。说明:此位置是相对于文档中的边缘线(边缘线由VerticalRelative属性定义)。 说明:如果表格文字环绕方式为无,则返回默认值1。
<P>
<DD><DL>

<DT><B>返回:</B><DD>表格相对于边缘线的垂直方向上的位置 <pre>     TableConstants.TABLE_GOTO_TOP      =1    顶端 TableConstants.TABLE_GOTO_BOTTOM   =2    底端 TableConstants.TABLE_GOTO_CENTER   =0    居中 TableConstants.TABLE_GOTO_INSIDE   =3    内侧 TableConstants.TABLE_GOTO_OUTSIDE  =4    外侧 </pre> <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); TableAttribute tableAttribute = table.getTableAttribute(); System.out.println("表格定位的垂直位置:" + tableAttribute.getVerticalPosition()); </pre><DT><B>另请参见:</B><DD><A HREF="../../../../application/workbooks/workbook/tables/TableAttribute.html#setVerticalPosition(int)"><CODE>setVerticalPosition(int)</CODE></A>, 
<A HREF="../../../../application/workbooks/workbook/tables/TableAttribute.html#getVerticalRelative()"><CODE>getVerticalRelative()</CODE></A>, 
<A HREF="../../../../application/constants/TableConstants.html" title="application.constants 中的接口"><CODE>TableConstants</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getVerticalRelative()"><!-- --></A><H3>
getVerticalRelative</H3>
<PRE>
public int <B>getVerticalRelative</B>()</PRE>
<DL>
<DD>得到表格垂直定位的相对于参数。说明:表格的垂直位置是相对于文档中的边缘线定位的,此参数就是边缘线的类型。 说明:如果表格文字环绕方式为无,则返回默认值2。
<P>
<DD><DL>

<DT><B>返回:</B><DD>表格垂直定位的边缘线的类型 <pre>     TableConstants.TABLE_MARGIN   =0     相对于页边距 TableConstants.TABLE_PAGE     =1     相对于页面 TableConstants.TABLE_COLUMN   =2     相对于栏 </pre> <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); TableAttribute tableAttribute = table.getTableAttribute(); System.out.println("表格垂直定位的边缘线的类型:" + tableAttribute.getVerticalRelative()); </pre><DT><B>另请参见:</B><DD><A HREF="../../../../application/workbooks/workbook/tables/TableAttribute.html#setVerticalRelative(int)"><CODE>setVerticalRelative(int)</CODE></A>, 
<A HREF="../../../../application/workbooks/workbook/tables/TableAttribute.html#getVerticalPosition()"><CODE>getVerticalPosition()</CODE></A>, 
<A HREF="../../../../application/constants/TableConstants.html" title="application.constants 中的接口"><CODE>TableConstants</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="isAllowAdjustSpacing()"><!-- --></A><H3>
isAllowAdjustSpacing</H3>
<PRE>
public boolean <B>isAllowAdjustSpacing</B>()</PRE>
<DL>
<DD>判断是否允许调整表格默认的单元格间距。
<P>
<DD><DL>

<DT><B>返回:</B><DD>是否可以调整默认单元格间距,true 表示可以调整 <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); TableAttribute tableAttribute = table.getTableAttribute(); System.out.println("是否可以调整表格默认的单元格间距:" + tableAttribute.isAllowAdjustSpacing()); </pre><DT><B>另请参见:</B><DD><A HREF="../../../../application/workbooks/workbook/tables/TableAttribute.html#getAdjustableSpacing()"><CODE>getAdjustableSpacing()</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="isAllowAutoFit()"><!-- --></A><H3>
isAllowAutoFit</H3>
<PRE>
public boolean <B>isAllowAutoFit</B>()</PRE>
<DL>
<DD>判断是否允许表格的列宽重调整尺寸以适应内容。
<P>
<DD><DL>

<DT><B>返回:</B><DD>表格是否会重调整尺寸以适应内容,true表示重调整尺寸 <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); TableAttribute tableAttribute = table.getTableAttribute(); System.out.println("表格的列宽是否会根据单元格中的内容自动调整:" + tableAttribute.isAllowAutoFit()); </pre><DT><B>另请参见:</B><DD><A HREF="../../../../application/workbooks/workbook/tables/TableAttribute.html#setAllowAutoFit(boolean)"><CODE>setAllowAutoFit(boolean)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="isAllowOverlap()"><!-- --></A><H3>
isAllowOverlap</H3>
<PRE>
public boolean <B>isAllowOverlap</B>()</PRE>
<DL>
<DD>返回当前表格是否允许被其他表格叠加。 说明:如果表格文字环绕方式为无,则返回默认值false。
<P>
<DD><DL>

<DT><B>返回:</B><DD>表格与表格是否能够叠加,true表示能够被其他表格叠加 <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); TableAttribute tableAttribute = table.getTableAttribute(); System.out.println("表格与表格是否能够被叠加:" + tableAttribute.isAllowOverlap()); </pre><DT><B>另请参见:</B><DD><A HREF="../../../../application/workbooks/workbook/tables/TableAttribute.html#setAllowOverlap(boolean)"><CODE>setAllowOverlap(boolean)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="isWrapAroundText()"><!-- --></A><H3>
isWrapAroundText</H3>
<PRE>
public boolean <B>isWrapAroundText</B>()</PRE>
<DL>
<DD>返回表格的环绕方式。
<P>
<DD><DL>

<DT><B>返回:</B><DD>tableRound  表格是否为文本环绕方式,true表示文本环绕 <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); TableAttribute tableAttribute = table.getTableAttribute(); System.out.println("表格是否为环绕方式:" + tableAttribute.isWrapAroundText()); </pre><DT><B>另请参见:</B><DD><A HREF="../../../../application/workbooks/workbook/tables/TableAttribute.html#setWrapAroundText(boolean)"><CODE>setWrapAroundText(boolean)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="setAdjustableSpacing(float)"><!-- --></A><H3>
setAdjustableSpacing</H3>
<PRE>
public void <B>setAdjustableSpacing</B>(float&nbsp;spacing)</PRE>
<DL>
<DD>设置表格的默认单元格间距。说明:如果间距值为0,则表示默认单元格间距不允许被调整。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>spacing</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); TableAttribute tableAttribute = table.getTableAttribute(); tableAttribute.setAdjustableSpacing(20.0f); table.setTableAttribute(tableAttribute); </pre>
<DT><B>抛出:</B>
<DD><CODE><A HREF="../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 当默认单元格间距不允许被调整时
<DD><CODE><A HREF="../../../../application/exceptions/MacroRunException.html" title="application.exceptions 中的类">MacroRunException</A></CODE> - 当指定间距超出范围0~158.9磅<DT><B>另请参见:</B><DD><A HREF="../../../../application/workbooks/workbook/tables/TableAttribute.html#getAdjustableSpacing()"><CODE>getAdjustableSpacing()</CODE></A>, 
<A HREF="../../../../application/workbooks/workbook/tables/TableAttribute.html#isAllowAdjustSpacing()"><CODE>isAllowAdjustSpacing()</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="setAlignment(int)"><!-- --></A><H3>
setAlignment</H3>
<PRE>
public void <B>setAlignment</B>(int&nbsp;tableAlign)</PRE>
<DL>
<DD>设置表格的对齐方式。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>tableAlign</CODE> - 表格的对齐方式,只能取以下整型值之一: <pre> TableConstants.TABLE_LEFT   = 0      左对齐 TableConstants.TABLE_CENTER = 1      居中对齐   TableConstants.TABLE_RIGHT  = 2      右对齐 </pre>              <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); TableAttribute tableAttribute = table.getTableAttribute(); tableAttribute.setAlignment(TableConstants.TABLE_CENTER); table.setTableAttribute(tableAttribute); </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/TableAttribute.html#getAlignment()"><CODE>getAlignment()</CODE></A>, 
<A HREF="../../../../application/constants/TableConstants.html" title="application.constants 中的接口"><CODE>TableConstants</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="setAllowAutoFit(boolean)"><!-- --></A><H3>
setAllowAutoFit</H3>
<PRE>
public void <B>setAllowAutoFit</B>(boolean&nbsp;autofit)</PRE>
<DL>
<DD>设置允许表格的列宽重调整尺寸以适应内容。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>autofit</CODE> - 表格是否会重调整尺寸以适应内容,true表示重调整尺寸 <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); TableAttribute tableAttribute = table.getTableAttribute(); tableAttribute.setAllowAutoFit(true); table.setTableAttribute(tableAttribute); </pre><DT><B>另请参见:</B><DD><A HREF="../../../../application/workbooks/workbook/tables/TableAttribute.html#isAllowAutoFit()"><CODE>isAllowAutoFit()</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="setAllowOverlap(boolean)"><!-- --></A><H3>
setAllowOverlap</H3>
<PRE>
public void <B>setAllowOverlap</B>(boolean&nbsp;overlap)</PRE>
<DL>
<DD>设置当前表格是否允许被其他表格叠加。
<P>
<DD><DL>
<DT><B>参数:</B><DD><CODE>overlap</CODE> - 表格与表格是否能够叠加,true表示能够被其他表格叠加 <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); TableAttribute tableAttribute = table.getTableAttribute(); tableAttribute.setWrapAroundText(true); tableAttribute.setAllowOverlap(true); table.setTableAttribute(tableAttribute); </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/TableAttribute.html#isAllowOverlap()"><CODE>isAllowOverlap()</CODE></A></DL>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -