Don't know how well title described my question, but anyway.
Did you ever try to present tabular data which would be somehow defined at one place only?
For example, I define table structure at one place only (database and presentation) and then preaty much everything else would be handled by some general rutines:
1. create table header
2. request only defined columns from database
3. show result
I thought I could create a key/value array where key would be db field name and value is header title. I could easly build sql statement and so on.
BUT, then I always start to think: what if I want more a complex db query? concatenated fields, joins, etc.?
Idealy I would like one rather "simple" definition statement which would declare everything for some general universal routines to show table.