doulu8341 2012-04-27 06:23
浏览 35

在docx文件中创建表

I have troubling to write colorful heading of table or colored background of table in docx or doc file for three days but i cant finding the proper solution. I am using a php library phpdocx to generate docx files.

Can any one please tell me what i am doing wrong here ?

Here is my code i am trying with :

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');

It's generating simple table table without any formatting like border,color etc.

Thanks a lot.

Any help would be greatly appreciated.

  • 写回答

1条回答 默认 最新

  • dongsi7067 2012-09-09 11:47
    关注

    Use .Net my friend :) - There is the Open XML SDK wich is very powerful.

    评论

报告相同问题?

悬赏问题

  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计