【问题标题】:create table in docx file在 docx 文件中创建表
【发布时间】:2012-04-27 06:23:44
【问题描述】:

我在 docx 或 doc 文件中写了彩色的表格标题或彩色的表格背景三天,但我找不到合适的解决方案。我正在使用 php 库 phpdocx 来生成 docx 文件。

谁能告诉我我在这里做错了什么?

这是我正在尝试的代码:

require_once '../../classes/CreateDocx.inc';


    $docx = new CreateDocx();
    //Tables
    $valuesTable = array(
    array(
            'head 1','head 2','head 3','head 4','head 5','head 6','head 7','head 8','head 9','head 10'
        ),
        array(
            11,12,13,14,15,16,17,18,19,20
        ),
        array(
            21,22,23,24,25,26,27,28,29,30
        ),
    );

    $paramsTable = array(
        'border' => 'single',
        'border_sz' => 20,
        'TBLSTYLEval' => 'MediumGrid3-accent5PHPDOCX'
    );

    //$paramsTable = array('TBLSTYLEval' => 'MediumGrid3-accent5PHPDOCX');

    $docx->addTable($valuesTable, $paramsTable);
    ##########################

    $docx->createDocx('example_image');

它生成简单的表格,没有任何格式,如边框、颜色等。

非常感谢。

任何帮助将不胜感激。

【问题讨论】:

    标签: php asp.net mysql docx phpdoc


    【解决方案1】:

    使用 .Net 我的朋友 :) - Open XML SDK 非常强大。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-01-03
      • 1970-01-01
      • 2012-04-15
      • 2016-09-06
      • 2011-12-02
      • 1970-01-01
      相关资源
      最近更新 更多