$section->addListItem($text, [$depth], [$fontStyle], [$listStyle], [$paragraphStyle]);$listItemRun = $section->addListItemRun([$depth], [$listStyle], [$paragraphStyle]); Basic UsageaddListItem is used for creating lists that only contain plain text. addListItemRun is used for creating complex list items that contains texts with different style (some bold, other italics, etc) or other elements, e.g. images or links.
Simpler Method to Add a table : replacing a placeholder with Template Processor Replace an Existing Table with ZipArchive Class
Two nice references https://phpword.readthedocs.io/en/latest/templates-processing.htmlhttps://hotexamples.com/examples/-/PhpOffice%255CPhpWord%255CTemplateProcessor/-/php-phpoffice%255cphpword%255ctemplateprocessor-class-examples.html An example for using phpWord Templates can be found here: http://phpword.readthedocs.org/en/latest/templates.html
PHP Word provides \PhpOffice\PhpWord\IOFactory::createReader . its ‘load’ method returns contents as an object However , this object is too complex if the intention is to just get the text contents for search. The complete Code would look like this. So a simpler way could be adopted using PHP ‘zip_read’
PHP Word provides different options to add table https://github.com/DerekMarcinyshyn/phpword/blob/master/samples/Sample_09_Tables.php Here is a sample code with few options
PHP Word documentation : https://phpword.readthedocs.io/en/latest/installing.html The library for phpWord can be found here: https://github.com/PHPOffice/PHPWord Sample codes : https://github.com/PHPOffice/PHPWord/tree/develop/samples A nice tutorial to beginwith https://redstapler.co/phpword-intro/ Install PHPWord via Composer (Composer is a Dependency Manager Tool for PHP. Like npm for Node.js) Add the below code to your composer.json file. In command prompt and type below to trigger the…
Bootstrap 4 Grid System Bootstrap’s grid system is built with flexbox and allows up to 12 columns across the page. If you do not want to use all 12 columns individually, you can group the columns together to create wider columns: Grid Classes The Bootstrap 4 grid system has five classes: .col- (extra small devices…
Other utilities, such as borders and colors, are also often used together with containers : Example Responsive Containers You can also use the .container-sm|md|lg|xl classes to create responsive containers. The max-width of the container will change on different screen sizes/viewports: Class Extra small<576px Small≥576px Medium≥768px Large≥992px Extra large≥1200px .container-sm 100% 540px 720px 960px 1140px .container-md…
‘rem’ stands for ‘root-element’ size Bootstrap 4 uses a default font-size of 16px, and its line-height is 1.5. The default font-family is “Helvetica Neue”, Helvetica, Arial, sans-serif. In addition, all <p> elements have margin-top: 0 and margin-bottom: 1rem (16px by default). Containers There are 2 types of Containers container : class provides a responsive fixed…