Visual Builder

Get Involved. Join the Conversation.


    oj-table td element colspan
    Topic posted October 10, 2019 by Nandan, tagged Layout, Style 
    17 Views, 1 Comment
    oj-table td element colspan
    colspan attribute of td element in oj-table


    I am using oj-table to display rows of data, with each row having a different layout. I am achieving this using <oj-bind-if> inside column template slot and referring to a value in the current row ($current.row.row_type ) to dynamically decide what to render in the row.

    I need to merge columns if the row is of a certain type ($current.row.row_type) and I plan to use colspan attribute of td element. But I noticed that VBCS/Jet adds its own td element even if I wrap the contents of <oj-bind-if> within <td> </td>. I am able to achieve this using a Javascript function called from an action chain. But this approach is not very stable and I am looking for a VBCS declarative/CSS approach.

    Can I stop VBCS/JET from adding its own td tag and force it to consider the td tag provided in the template slot?







    • Duncan Mills

      With oj-table you'd have to fall back to using a row-renderer function which would need to you write the row DOM out from JavaScript.

      I'd actually consider if you need to use table at all?  If you are not using the sorting and column management capabilities then maybe using oj-list-view would be a much better choice - you can use a grid or flex based layout within the list view template for each row and that should give you all the flexibility you need and still maintain scrolling and all that. 

      The other alternative is to go much more complex and use oj-data-grid which will allow colspans and rowspans but is more complex overall.