PHPExcel边框样式在PHPExcel_Style_Border
类中定义为常量。实心的是BORDER_THIN
,BORDER_MEDIUM
和BORDER_THICK
。然而,中等和厚实的太厚了以至于我的需要。有没有办法手动设置边框厚度?
答案 0 :(得分:3)
定义PHPExcel边框样式以模仿MS Excel本身可用的样式 ECMA OfficeOpenXML规范(第3版)在文档的ST_BorderStyle部分(第18.18.3节,第2671-2673页)中定义了可用的边框样式,并在xsd中定义为:
<xsd:simpleType name="ST_BorderStyle">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="none"/>
<xsd:enumeration value="thin"/>
<xsd:enumeration value="medium"/>
<xsd:enumeration value="dashed"/>
<xsd:enumeration value="dotted"/>
<xsd:enumeration value="thick"/>
<xsd:enumeration value="double"/>
<xsd:enumeration value="hair"/>
<xsd:enumeration value="mediumDashed"/>
<xsd:enumeration value="dashDot"/>
<xsd:enumeration value="mediumDashDot"/>
<xsd:enumeration value="dashDotDot"/>
<xsd:enumeration value="mediumDashDotDot"/>
<xsd:enumeration value="slantDashDot"/>
</xsd:restriction>
这是为BIFF文件格式定义的边框样式列表,我找不到任何用于定义自定义样式或尺寸的规定。
修改强>
复杂边框样式只是将颜色信息添加到格式
<xsd:complexType name="CT_Border">
<xsd:sequence>
<xsd:element name="start" type="CT_BorderPr" minOccurs="0" maxOccurs="1"/>
<xsd:element name="end" type="CT_BorderPr" minOccurs="0" maxOccurs="1"/>
<xsd:element name="top" type="CT_BorderPr" minOccurs="0" maxOccurs="1"/>
<xsd:element name="bottom" type="CT_BorderPr" minOccurs="0" maxOccurs="1"/>
<xsd:element name="diagonal" type="CT_BorderPr" minOccurs="0" maxOccurs="1"/>
<xsd:element name="vertical" type="CT_BorderPr" minOccurs="0" maxOccurs="1"/>
<xsd:element name="horizontal" type="CT_BorderPr" minOccurs="0" maxOccurs="1"/>
</xsd:sequence>
<xsd:attribute name="diagonalUp" type="xsd:boolean" use="optional"/>
<xsd:attribute name="diagonalDown" type="xsd:boolean" use="optional"/>
<xsd:attribute name="outline" type="xsd:boolean" use="optional" default="true"/>
</xsd:complexType>
<xsd:complexType name="CT_BorderPr">
<xsd:sequence>
<xsd:element name="color" type="CT_Color" minOccurs="0" maxOccurs="1"/>
</xsd:sequence>
<xsd:attribute name="style" type="ST_BorderStyle" use="optional" default="none"/>
</xsd:complexType>