The following snippet will show, how you can pass a data array to a function, and generate a table with N columns.
$data contains some dummy data, which can come from any data source. Then you call
createHtmlTable passing the data, the number of columns you want, and a function, which will be called for each row, where you can specify the exact layout of each cell. I hope the comments speak for themselves. If not, please reply and let me know.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.