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

📄 tableattribute.html

📁 永中OFFICE二次开发帮助文档
💻 HTML
📖 第 1 页 / 共 5 页
字号:
 </pre><DT><B>另请参见:</B><DD><A HREF="../../../../application/workbooks/workbook/tables/TableAttribute.html#setDefaultCellBottomMargin(float)"><CODE>setDefaultCellBottomMargin(float)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getDefaultCellLeftMargin()"><!-- --></A><H3>
getDefaultCellLeftMargin</H3>
<PRE>
public float <B>getDefaultCellLeftMargin</B>()</PRE>
<DL>
<DD>得到表格默认的单元格左边距。说明:边距的范围为0~1584磅。
<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); TableAttribute tableAttribute = table.getTableAttribute(); System.out.println("表格默认的单元格左边距为:" + tableAttribute.getDefaultCellLeftMargin()); </pre><DT><B>另请参见:</B><DD><A HREF="../../../../application/workbooks/workbook/tables/TableAttribute.html#setDefaultCellLeftMargin(float)"><CODE>setDefaultCellLeftMargin(float)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getDefaultCellRightMargin()"><!-- --></A><H3>
getDefaultCellRightMargin</H3>
<PRE>
public float <B>getDefaultCellRightMargin</B>()</PRE>
<DL>
<DD>得到表格默认的单元格右边距。说明:边距的范围为0~1584磅。
<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); TableAttribute tableAttribute = table.getTableAttribute(); System.out.println("表格默认的单元格右边距为:" + tableAttribute.getDefaultCellRightMargin()); </pre><DT><B>另请参见:</B><DD><A HREF="../../../../application/workbooks/workbook/tables/TableAttribute.html#setDefaultCellRightMargin(float)"><CODE>setDefaultCellRightMargin(float)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getDefaultCellTopMargin()"><!-- --></A><H3>
getDefaultCellTopMargin</H3>
<PRE>
public float <B>getDefaultCellTopMargin</B>()</PRE>
<DL>
<DD>得到表格默认的单元格上边距。说明:边距的范围为0~1584磅。
<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); TableAttribute tableAttribute = table.getTableAttribute(); System.out.println("表格默认的单元格上边距为:" + tableAttribute.getDefaultCellTopMargin()); </pre><DT><B>另请参见:</B><DD><A HREF="../../../../application/workbooks/workbook/tables/TableAttribute.html#setDefaultCellTopMargin(float)"><CODE>setDefaultCellTopMargin(float)</CODE></A></DL>
</DD>
</DL>
<HR>

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

<DT><B>返回:</B><DD>表格相对于边缘线的水平方向上的位置 <pre>     TableConstants.TABLE_GOTO_LEFT     =1    左侧 TableConstants.TABLE_GOTO_RIGHT    =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.getHorizontalPosition()); </pre><DT><B>另请参见:</B><DD><A HREF="../../../../application/workbooks/workbook/tables/TableAttribute.html#setHorizontalPosition(int)"><CODE>setHorizontalPosition(int)</CODE></A>, 
<A HREF="../../../../application/workbooks/workbook/tables/TableAttribute.html#getHorizontalRelative()"><CODE>getHorizontalRelative()</CODE></A></DL>
</DD>
</DL>
<HR>

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

<DT><B>返回:</B><DD>表格水平定位的边缘线的类型 <pre>     TableConstants.TABLE_MARGIN       =0     相对于页边距 TableConstants.TABLE_PAGE         =1     相对于页面 TableConstants.TABLE_PARAGRAPH    =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.getHorizontalRelative()); </pre><DT><B>另请参见:</B><DD><A HREF="../../../../application/workbooks/workbook/tables/TableAttribute.html#setHorizontalRelative(int)"><CODE>setHorizontalRelative(int)</CODE></A>, 
<A HREF="../../../../application/workbooks/workbook/tables/TableAttribute.html#getHorizontalPosition()"><CODE>getHorizontalPosition()</CODE></A>, 
<A HREF="../../../../application/constants/TableConstants.html" title="application.constants 中的接口"><CODE>TableConstants</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getLeftDistance()"><!-- --></A><H3>
getLeftDistance</H3>
<PRE>
public float <B>getLeftDistance</B>()</PRE>
<DL>
<DD>得到正文文本与表格之间的左边距。 说明:如果表格文字环绕方式为无,则返回默认值0。
<P>
<DD><DL>

<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.getLeftDistance()); </pre><DT><B>另请参见:</B><DD><A HREF="../../../../application/workbooks/workbook/tables/TableAttribute.html#setLeftDistance(float)"><CODE>setLeftDistance(float)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getLeftIndent()"><!-- --></A><H3>
getLeftIndent</H3>
<PRE>
public float <B>getLeftIndent</B>()</PRE>
<DL>
<DD>获得表格的左缩进距离,当其小于零时为突出多少距离。 说明:如果表格不是左对齐或者表格嵌入文本采用了文本环绕方式,则返回默认值0。
<P>
<DD><DL>

<DT><B>返回:</B><DD>表格的左缩进距离(单位为磅值),取值范围为-1080到1080之间 <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.getLeftIndent()); </pre><DT><B>另请参见:</B><DD><A HREF="../../../../application/workbooks/workbook/tables/TableAttribute.html#setLeftIndent(float)"><CODE>setLeftIndent(float)</CODE></A>, 
<A HREF="../../../../application/constants/TableConstants.html" title="application.constants 中的接口"><CODE>TableConstants</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getPreferredWidth()"><!-- --></A><H3>
getPreferredWidth</H3>
<PRE>
public float <B>getPreferredWidth</B>()</PRE>
<DL>
<DD>得到指定表格的宽度。
<P>
<DD><DL>

<DT><B>返回:</B><DD>返回表格的宽度 说明:列宽的度量类型不同,列宽值的语义也不一样。如果,度量类型为固定值,则返回列宽值为磅值,范围在0~1584磅; 如果度量类型为百分比,则返回列宽值是一个相对值,范围在0~100%。 <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.getPreferredWidth()); </pre><DT><B>另请参见:</B><DD><A HREF="../../../../application/workbooks/workbook/tables/TableAttribute.html#setPreferredWidth(float)"><CODE>setPreferredWidth(float)</CODE></A>, 
<A HREF="../../../../application/workbooks/workbook/tables/TableAttribute.html#getPreferredWidthMeasure()"><CODE>getPreferredWidthMeasure()</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getPreferredWidthMeasure()"><!-- --></A><H3>
getPreferredWidthMeasure</H3>
<PRE>
public int <B>getPreferredWidthMeasure</B>()</PRE>
<DL>
<DD>得到指定表格宽度的度量方式。
<P>
<DD><DL>

<DT><B>返回:</B><DD>表格宽度的度量方式,只能取以下值之一: <pre> TableConstants.TABLE_WIDTH_NONE_SET  不指定表格宽度 TableConstants.TABLE_WIDTH_MEASURE   指定宽度为绝对值 TableConstants.TABLE_WIDTH_PRECENT   指定宽度为百分比 </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.getPreferredWidthMeasure()); </pre><DT><B>另请参见:</B><DD><A HREF="../../../../application/workbooks/workbook/tables/TableAttribute.html#setPreferredWidthMeasure(int)"><CODE>setPreferredWidthMeasure(int)</CODE></A>, 
<A HREF="../../../../application/constants/TableConstants.html" title="application.constants 中的接口"><CODE>TableConstants</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getRightDistance()"><!-- --></A><H3>
getRightDistance</H3>
<PRE>
public float <B>getRightDistance</B>()</PRE>
<DL>
<DD>得到正文文本与表格之间的右边距。 说明:如果表格文字环绕方式为无,则返回默认值0。
<P>
<DD><DL>

<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.getRightDistance()); </pre><DT><B>另请参见:</B><DD><A HREF="../../../../application/workbooks/workbook/tables/TableAttribute.html#setRightDistance(float)"><CODE>setRightDistance(float)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getTopDistance()"><!-- --></A><H3>
getTopDistance</H3>
<PRE>
public float <B>getTopDistance</B>()</PRE>
<DL>
<DD>得到正文文本与表格之间的上边距。 说明:如果表格文字环绕方式为无,则返回默认值0。
<P>
<DD><DL>

⌨️ 快捷键说明

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