-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
row span? #74
Comments
that is cellspan, what I need is rowspan, it should be done this way: $cell->getStyle()->setVMerge(2); but that is not working properly |
In memory, it's @kaystrobach who have implemented rowspan and colspan to cell in PR #21. May be, could he help us on this point ? |
@carlosrochap can you please post you document creation code snippet? the work for rowspan and colspan is based on http://tegarrputra.wordpress.com/2011/11/02/merging-cells-in-msword-2007-table-using-phpword/ as stated in my original issue #21 In my case both worked fine. |
sure, here is my code, I have tried different approaches but no luck so far, thanks for your help. require_once '../Classes/PHPWord.php'; $section = $PHPWord->createSection(); $sc = $table->addCell(10); $table->addCell(10)->addText('Cell 21'); $style = $sc->getStyle(); // Save File |
if i read your code right you make 2x2 cells and try to make rowspan the firstone please try to make the following
then you should be able to rowspan cell a |
mm, here is what I need:
in your example C has just a colspan of 2, I need rowspan too to do something like the previous example |
See $section->addTextBreak(1);
$section->addText("Table with colspan and rowspan", $header);
$styleTable = array('borderSize' => 6, 'borderColor' => '999999');
$cellRowSpan = array('vMerge' => 'restart', 'valign' => 'center');
$cellRowContinue = array('vMerge' => 'continue');
$cellColSpan = array('gridSpan' => 2, 'valign' => 'center');
$cellHCentered = array('align' => 'center');
$cellVCentered = array('valign' => 'center');
$PHPWord->addTableStyle('Colspan Rowspan', $styleTable);
$table = $section->addTable('Colspan Rowspan');
$table->addRow();
$table->addCell(2000, $cellRowSpan)->addText('A', null, $cellHCentered);
$table->addCell(4000, $cellColSpan)->addText('B', null, $cellHCentered);
$table->addCell(2000, $cellRowSpan)->addText('E', null, $cellHCentered);
$table->addRow();
$table->addCell(null, $cellRowContinue);
$table->addCell(2000, $cellVCentered)->addText('C', null, $cellHCentered);
$table->addCell(2000, $cellVCentered)->addText('D', null, $cellHCentered);
$table->addCell(null, $cellRowContinue); |
is it working as expected? |
perfect |
Thank you ;), I will try that on my project |
@carlosrochap When you will test, could you send us a feedback in order that I close this issue ? |
Sure, I will do it this week, not sure which day, but I will let you know right away.. |
@carlosrochap Some news ? |
sorry for the delay, it's working like a charm :), thanks @ivanlanin / everyone |
I close it :) |
Yay! One more issue closed :) Thanks @carlosrochap |
I've been running version 0.6.3 of PHPWord for a while now and have it doing mostly what I want it to do, but I see there are new features in version 0.8 that would completely do what I need. I downloaded the zip file from GitHub and replaced my /classes folder with the new /classes folder and even with the most basic of test files, I immediately get this error: Fatal error: Class 'PHPWord_DocumentProperties' not found in E:\Inetpub\wwwroot\mysite\Classes\PHPWord.php on line 99. |
You need to open a new issue with this. |
Thanks, I'm a github newb. |
i have tried what was done by @ivanlanin but it didn't work. even just a colspan it didn't work too. i use codeigniter. the message below it. somebody help me please :( |
please open the docx as zip file and search for the content you are expecting in the cell. Additionally show the details from the alert Word displays ... |
@kaystobach thx alot.. i have found a way. the problems is defference version of phpword that i used. the above code has worked now. :D |
Glad to know it's working :) |
ivanlanin - your code in my PHPWord 0.6.3 version gives me something like that. Why? |
And one more question - I have no possibility to use Composer. Where can I found pack PHPWord code which I can use without Composer (autoload.php and Vendor)? |
@markoniusz |
Package it yourself as stated Von meinem iPhone gesendet
|
Can't I use rowspan on |
@SuperHaoHaoHao english please - otherwise it’s hard to follow the discussion |
I am also interested in knowing how to build a table like the one posted by @sajuuk78 |
I
When I try to create pdf from this example, in column "E" missing "rowspan", do you know what can be a problem? |
how do I create cells with rowspan more than 1?
The text was updated successfully, but these errors were encountered: