第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會有你想問的

無法在表格中添加邊框樣式 (phpword)

無法在表格中添加邊框樣式 (phpword)

PHP
茅侃侃 2022-09-03 14:47:29
我正在嘗試在html內(nèi)的表格中添加邊框。下面是我的代碼$phpWord = new \PhpOffice\PhpWord\PhpWord();$section = $phpWord->addSection();$html = "<table border='1'><tr><th>name</th></tr><tr><td>John</td></tr></table>";\PhpOffice\PhpWord\Shared\Html::addHtml($section, $html );header('Content-Type: application/octet-stream');header('Content-Disposition: attachment;filename="test.docx"');$objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'Word2007');$objWriter->save('php://output');我已經(jīng)分配了一個(gè)1的邊界,但它不起作用。我的表格中沒有邊框它事件不能通過添加樣式來工作。請幫忙
查看完整描述

2 回答

?
阿晨1998

TA貢獻(xiàn)2037條經(jīng)驗(yàn) 獲得超6個(gè)贊

在這種情況下,請使用內(nèi)聯(lián) CSS。你應(yīng)該這樣做:


require_once __DIR__ . '/vendor/autoload.php';


use PhpOffice\PhpWord\IOFactory;

use PhpOffice\PhpWord\PhpWord;

use PhpOffice\PhpWord\Shared\Html;


$phpWord = new PhpWord();

$section = $phpWord->addSection();

$html = "<table style="border: 1px solid black;">

<tr>

<th>name</th>

</tr>

<tr><td>John</td></tr>

</table>";

Html::addHtml($section, $html);

header('Content-Type: application/octet-stream');

header('Content-Disposition: attachment;filename="test.docx"');

$objWriter = IOFactory::createWriter($phpWord);

$objWriter->save('php://output');


查看完整回答
反對 回復(fù) 2022-09-03
?
蝴蝶不菲

TA貢獻(xiàn)1810條經(jīng)驗(yàn) 獲得超4個(gè)贊

嘗試以最少的更改運(yùn)行代碼,并且全部工作)


require_once __DIR__ . '/vendor/autoload.php';


use PhpOffice\PhpWord\IOFactory;

use PhpOffice\PhpWord\PhpWord;

use PhpOffice\PhpWord\Shared\Html;


$phpWord = new PhpWord();

$section = $phpWord->addSection();

$html = "<table border='1'>

<tr>

<th>name</th>

</tr>

<tr><td>John</td></tr>

</table>";

Html::addHtml($section, $html);

header('Content-Type: application/octet-stream');

header('Content-Disposition: attachment;filename="test.docx"');

$objWriter = IOFactory::createWriter($phpWord);

$objWriter->save('php://output');


查看完整回答
反對 回復(fù) 2022-09-03
  • 2 回答
  • 0 關(guān)注
  • 237 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號