I have 2 arrays, but the 2 have different key values you can see in foreach for one it is src, where as for another it is source. I would like to show the both both tables on one hook. But this seems not working.


The issue is you're passing elements that a render array would use, such as the "#rows", "#sticky", etc, but Form API will ignore them, because anything prefixed with a "#" will be treated as a property of the form element.

Clive gives here (https://drupal.stackexchange.com/a/27269/28556) a very concise explanation and solution for that, which consists in creating your own theme function to render a particular element.

Additionally, I think you could, as well, use the existing theme('table', ...) function to render the table from that same function, but returning the results as direct markup instead.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.