当前位置: 首页>>代码示例>>PHP>>正文


PHP CreateDocx::embedHTML方法代码示例

本文整理汇总了PHP中CreateDocx::embedHTML方法的典型用法代码示例。如果您正苦于以下问题:PHP CreateDocx::embedHTML方法的具体用法?PHP CreateDocx::embedHTML怎么用?PHP CreateDocx::embedHTML使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CreateDocx的用法示例。


在下文中一共展示了CreateDocx::embedHTML方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: CreateDocx

//path to  the CreateDocx class within your PHPDocX installation
require_once '../../../classes/CreateDocx.inc';
$docx = new CreateDocx();
$html = '<h1 style="color: #b70000">An embedHTML() example</h1>';
$html .= '<p>We draw a table with border and rawspans and colspans:</p>';
$html .= '<table border="1" style="border-collapse: collapse">
            <tbody>
                <tr>
                    <td style="background-color: yellow">1_1</td>
                    <td rowspan="3" colspan="2">1_2</td>
                </tr>
                <tr>
                    <td>Some random text.</td>
                </tr>
                <tr>
                    <td>
                        <ul>
                            <li>One</li>
                            <li>Two <b>and a half</b></li>
                        </ul>
                    </td>
                </tr>
                <tr>
                    <td>3_2</td>
                    <td>3_3</td>
                    <td>3_3</td>
                </tr>
            </tbody>
        </table>';
$docx->embedHTML($html);
$docx->createDocx('example_embedHTML_1');
开发者ID:Ezyva2015,项目名称:SMSF-Academy-Wordpress,代码行数:31,代码来源:sample_1.php

示例2: array

$myList = array($myItem, 'item 2', array('subitem 2_1', 'subitem 2_2'), 'item 3', array('subitem 3_1', 'subitem 3_2', array('sub_subitem 3_2_1', 'sub_subitem 3_2_1')), 'item 4');
$docx->addList($myList, array('val' => 1));
$valuesTable = array(array('cell_1_1', 'cell_1_2', 'cell_1_3', 'cell_1_4'), array('cell_2_1', 'cell_2_2', 'cell_2_3', 'cell_2_4'), array('cell_3_1', 'cell_3_2', 'cell_3_3', 'cell_3_4'));
$paramsTable = array('TBLSTYLEval' => 'MediumGrid3-accent5PHPDOCX');
$docx->addTable($valuesTable, $paramsTable);
$myHTML = '<br /><p style="font-family: Calibri; font-size: 11pt">We include a table with rowspans and colspans using the embedHTML method.</p>
<table style="font-family: Calibri; font-size: 11pt">
  <tr>
	  <td>header 1</td>
	  <td>header 2</td>
	  <td>header 3</td>
	  <td>header 4</td>
  </tr>
  <tr>
	  <td rowspan="2" colspan="2">cell_1_1</td>
	  <td>cell_1_3</td>
	  <td>cell_1_4</td>
  </tr>
  <tr>
	  <td>cell_2_3</td>
	  <td>cell_2_4</td>
  </tr>
  <tr>
	  <td>cell_3_1</td>
	  <td>cell_3_2</td>
	  <td>cell_3_3</td>
	  <td>cell_3_4</td>
  </tr>
</table>';
$docx->embedHTML($myHTML, array('tableStyle' => 'MediumGrid3-accent5PHPDOCX'));
$docx->createDocx('../word_documents/example_table_style_HTML');
开发者ID:Ezyva2015,项目名称:SMSF-Academy-Wordpress,代码行数:31,代码来源:example8.php

示例3: CreateDocx

<?php

//path to  the CreateDocx class within your PHPDocX installation
require_once '../../../classes/CreateDocx.inc';
$docx = new CreateDocx();
$docx->embedHTML('<h1 style="color: #b70000">The Wikipedia Article on the Periodic Table</h1>');
$html = file_get_contents('http://en.wikipedia.org/wiki/Periodic_table');
$options = array('parseDivsAsPs' => true, 'baseURL' => 'http://en.wikipedia.org/', 'downloadImages' => true, 'filter' => '#bodyContent');
$docx->embedHTML($html, $options);
$docx->modifyPageLayout('A3-landscape');
$docx->createDocx('example_embedHTML_2');
开发者ID:Ezyva2015,项目名称:SMSF-Academy-Wordpress,代码行数:11,代码来源:sample_2.php


注:本文中的CreateDocx::embedHTML方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。