This commit is contained in:
wangjinlei
2024-07-17 09:23:45 +08:00
parent edf9deeb1a
commit 881ac3e056
1001 changed files with 41032 additions and 5452 deletions

View File

@@ -0,0 +1,62 @@
## Usage
To create a row, use the `PhpOffice\Math\Element\Row` class.
### Methods
#### add
The method add an element to the row.
The method has one parameter :
* `PhpOffice\Math\Element\AbstractElement` **$element**
#### getElements
The method return all elements of the row.
#### remove
The method remove an element to the row.
The method has one parameter :
* `PhpOffice\Math\Element\AbstractElement` **$element**
## Example
### Math
<math display="block">
<mrow>
<mn>1</mn>
<mo>+</mo>
<mi>K</mi>
</mrow>
</math>
### XML
``` xml
<math display="block">
<mrow>
<mn>1</mn>
<mo>+</mo>
<mi>K</mi>
</mrow>
</math>
```
### PHP
``` php
<?php
use PhpOffice\Math\Element;
use PhpOffice\Math\Math;
$math = new Math();
$row = new Element\Row();
$row->add(new Element\Numeric(1));
$row->add(new Element\Operator('+'));
$row->add(new Element\Identifier('K'));
$math->add($row);
```