Hello rompp,
I am the developper of the CustomFields module, so I can answer your question pretty precisely.
I have been trying to implement this feature quite recently among other features, and the short answer is that no, this isn’t possible.
The problem is with the HTML standard: Dolibarr uses tables to display the fields, and tables have a definite number of columns. A field cannot modify that, only the table generator can do that. Thus, a custom field cannot add a column on the fly to stack fields along the line. I have tried some workarounds, but they all ended up to be display quite horribly and destroy the whole table display.
Thus, there’s no way to automate that. Now you can of course manually modify the table’s generation in Dolibarr’s code on a case-per-case basis, by raising the total number of columns the table generate. But as I said, this will break the whole table display, because you will also have to modify how the standard Dolibarr’s fields fit in the table (there are a lots of fields using variable colspan values, and you have the photo card on the upper right of the table which is also a special case that you will have to adapt).
So, the bottom line is that even if it’s possible, it will be very tricky to do for you, this will cost you a good amount of time, and in the end the table may be broken (remember that Dolibarr has a lot of different scenarios, so even if your table shows correctly for you, you will have to test every possible combination of variables and settings for the module you are working on to ensure that the table doesn’t break when you add an optional feature, let’s say for example the photo card, or a comment note, etc.). Also, your table may break anytime in the future when you update your Dolibarr’s install, you will maybe have to redo all your work, things are changing fast currently in the codebase…
So I advise you to just tell your boss that this is too much complicated given today’s web standards and that this would break Dolibarr’s flexibility and maintenance, and that his time (and yours) is better spent elsewhere