Forum


Replies: 8   Views: 7337
Setting fixed width to first column in an html table
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by davelavinsky  · 21-12-2017 - 08:41

Im inserting a table using HTML in my DOCX.

$html .= "<table class='tbl' style='font-size:12px'>";
$html .= "<thead>
            <th width='250'></th>                
            <th>FY 1</th>
            <th>FY 2</th>
            <th>FY 3</th>
            <th>FY 4</th>
            <th>FY 5</th>
          </thead>
          ";

$html .= "<tbody>";    
          
$html .= "<tr>";
$html .= "<td width='250'>";
.
.
.
.
$docx->embedHTML($html);

But as you can see, the width is not 250 for column 1 and column 5 has a bigger width.

https://imgur.com/a/EJnQu

How do I change this ?