height


Cell/Row heightand vertical align in PhpWord


I'm starting a project where I want to use PhpWord 0.12. However, I'm having problems and the documentation is rather unclear on some things.
Can't set cell/row height. Doc says there's a Row style called exactHeight but it does nothing. I have some annoying white space under the text, like a new empty line? Tried a Paragraph style called spaceAfter (someone else had success with this) but again does nothing.
Vertical align won't work. Tried it in both addCell and addText. Docs says valign is a style in Cell. The weird thing is that align does work in addText even though it's not style for texts according the documentation.
I did a main table with 2 cells, and then nested a table in each of those cells to get 2 columns, does anyone know if there's a better way? colNums is mentioned in the docs but I can't understand what it's supposed to do...
The documentation is very strange? Some things will work but not where it's supposed to, others just won't do anything. I've looked at the sample tables and they have that exact same whitespace in those cells...
Appreciate any help!
OK, so the white space is gone. For some weird reason in the addText element I had to put the text, fontStyle and then paragraphStyle. Then a property called spaceAfter = 0 worked... Who would have known? The other questions are still unsolved.
Here's the paragrapgh style that worked:
$fontStyleCell = ['name' => 'Verdana', 'size' => 10, 'color' => '000000', 'bold' => true];
$paragraphStyle = ['align' => 'center', 'spaceAfter' => 0];
$cell_main_left = $table_main->addCell(5260);
$table_main_left = $cell_main_left->addTable($tableStyle);
$table_main_left->addRow();
$table_main_left->addCell(400)->addText('', $fontStyleCell, $paragraphStyle);
$table_main_left->addCell(400)->addText('#', $fontStyleCell, $paragraphStyle);
$table_main_left->addCell(400)->addText('Djup', $fontStyleCell, $paragraphStyle);
$table_main_left->addCell(400)->addText('Omb', $fontStyleCell, $paragraphStyle);
$table_main_left->addCell(400)->addText('Uppb', $fontStyleCell, $paragraphStyle);
$table_main_left->addCell(3260)->addText('Notering', $fontStyleCell, $paragraphStyle);

Related Links

how to set another elemtnt's height based on slider height in this context
Classic asp control character height in dropdown
Auto adjust row height to max height value
How to calculate Height of any control which is loaded in DataTemplate?
Xamarin Forms - Get the size of an AbsoluteLayout
Amcharts : small (sometimes 0px) chart height on page load (in default tab)
Spacing between 2 lines HTML/ PHP and CSS
How to change embedly height
Cell/Row heightand vertical align in PhpWord
How to make 2 divs to fill 100% viewport height
Script to remove element while clientHeight < “size”
how to auto-adjust App.js textarea height to fill the remainder of screen?
How to get my PDF with a dynamic height? Or calculate the height of contents before it is printed
Java Binary Tree Height
OpenRTB bid creative's dimensions
Confused on SDL_CreateRGBSurface() width and height parameters

Categories

HOME
crate
jsviews
mapping
wildcard
performancecounter
memory-leaks
ext.net
tumblr
urlencode
dropbear
rfid
automata
medium-editor
reduction
phpbb
tree-traversal
propel2
excel-2010
spring-test
geopandas
metadata-extractor
dd-wrt
sharp
gpib
exponential
ifstream
reactivemongo
openshift-enterprise
deepstream.io
viewgroup
xbim
stereo-3d
microdata
android-maps-v2
intersystems-ensemble
powermta
z3py
timesten
taskmanager
cgcontext
tofixed
hpcc
opencpu
unity3d-editor
gmt
festival
sqldatareader
gradle-script-kotlin
iostat
manifest.mf
asteriskami
shipitjs
inotifypropertychanged
spatial-query
project-online
remoteapp
selecteditem
asp.net-mvc-partialview
inet
cmocka
multinomial
jta
apache-mina
start-job
firebug-lite
argument-passing
funkload
ksoap2
edit-in-place
chrome-for-android
wic
confusion-matrix
loop-invariant
visual-studio-2003
argb
surveyor-gem
appfog
database-permissions
dropdownlistfor
enumerators
feof
jquery-selectbox
selectmanycheckbox
easygui
rubycas
server-error
pureftpd
exitstatus
sitemappath
aio
soft-keyboard
opcodes
castle-validators

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App