我正在努力创造一个没有边框的桌子,只给出了一个没有欢乐的td边框底部。我正在使用html与docword一起转换docx。我尝试过内联样式或使用“style.inc”文件,但没有运气:
Style.inc
"table" => array(
// Note that applying a table style in PHPWord applies the relevant style to
// ALL the cells in the table. So, for example, the borderSize applied here
// applies to all the cells, and not just to the outer edges of the table:
"size" => 11,
"border" => 0,
"width" => "100%",
"borderSize" => 0,
"lineHeight" => 20,
)
HTML:
$html .= '<table border="0" style="border: 0 none;">';
$html .= ' <tr>';
$html .= ' <td colspan="4"><h2>Header 1</h2></td>';
$html .= ' </tr>';
$html .= ' <tr>';
$html .= ' <th style="border: 0 none; border-bottom: 1px solid #000000;"><b>Site Address</b></th>';
$html .= ' <th style="border: 0 none; border-bottom: 1px solid #000000;"><b>No. of Units</b></th>';
$html .= ' <th style="border: 0 none; border-bottom: 1px solid #000000;"><b>Value</b></th>';
$html .= ' <th style="border: 0 none; border-bottom: 1px solid #000000;"><b>Size in m<sup>2</sup></b></th>';
$html .= ' </tr>';
$html .= ' <tr>';
$html .= ' <td style="vertical-align: middle" width="300">Sample Text</td>';
$html .= ' <td style="vertical-align: middle" width="300">Sample Text</td>';
$html .= ' <td style="vertical-align: middle" width="300">Sample Text</th>';
$html .= ' <td style="vertical-align: middle" width="300">Sample Text</td>';
$html .= ' </tr>';
$html .= ' <tr>';
$html .= ' <td colspan="4"><h2>Professional Contact Details:</h2></td>';
$html .= ' </tr>';
$html .= ' <tr>';
$html .= ' <th width="300"><b>Company</b></th>';
$html .= ' <th width="300"><b>Address</b></th>';
$html .= ' <th width="300"><b>Contact Person</b></th>';
$html .= ' <th width="300"><b>Contact</b></th>';
$html .= ' </tr>';
$html .= '</table>';