tableToArray ( string htmlOfTheTable ) : array
Transform an HTML table into an associative array of data. Column title are converted in text, and values are html content of td tags.
Example
Col A | Col B |
---|---|
1 | 2 |
3 | 4 |
[["Col A":"1","Col B":"2"],["Col A":"3","Col B":"4"]]
html = 'Col A Col B 1 2 3 4
'
console(tableToArray(html)) //-> [{Col A=1, Col B=2}, {Col A=3, Col B=4}]
Parameters
htmlOfTheTable
HTML code of the table element to transform into an associative array. Caution ! The <table> tag must be in the code.