Recently, I decorated a table using bootstrap and created a simple table view (collapsed) to display the data. Each row in the table contains two horizontal sets of data, with the expanded view appearing when the user clicks on the "Details" button.
The first set of data in each row consists of 4 columns, while the second set is intended to occupy the entire table width. However, I am not completely satisfied with my current approach. It involves utilizing Angular loop constructs to repeat the <tr>
element and embedding two tables within each <tr>
. This setup allows me to present the first data set in one table and the expanded view in another table, triggered by clicking on the "Details" button.
<table class="table-hover table-condensed">
<thead>
<tr>
<th align="left" class="span2">Date</th>
<th align="left" class="span2">Title</th>
<th align="left" class="span2">Bill Total</th>
<th align="left" class="span4">Options</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="ibill in user.groups[0].bills | filter:query | orderBy:'date'">
<td colspan="4">
<table>
<tr>
<td class="span2">{{ ibill.billDate | date:'MM/dd/yyyy'}}</td>
<td class="span2">{{ ibill.title }}</td>
<td class="span2">${{ ibill.billTotal }}</td>
<td class="span4">
<a ng-click='deleteBill(ibill.id)' class="btn btn-mini" ng-init="ibill.isCollapsed = 'true'" ng-click="ibill.isCollapsed = !ibill.isCollapsed"><i class="icon-trash"></i></a>
<a href="#/bills/edit/0/{{$index}}" class="btn btn-mini" ng-init="ibill.isCollapsed = 'true'" ng-click="ibill.isCollapsed = !ibill.isCollapsed"><i class="icon-edit"></i></a>
<a class="btn btn-mini" ng-init="ibill.isCollapsed = 'true'" ng-click="ibill.isCollapsed = !ibill.isCollapsed"><i class="icon-eye-open"></i> details</a>
</td>
</tr>
</table>
<table>
<tr>
<td colspan="4">
<div collapse="ibill.isCollapsed">
<div>
<p ng-repeat="simplecost in ibill.billSimpleEntry.simpleUserIdAndLiableCost">{{simplecost.user.fName}} owes ${{simplecost.liableCost}}</p>
</div>
</div>
</td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
However, I'm considering alternative designs that eliminate the need for two tables per row. I'm exploring options for achieving the same functionality without relying on traditional tabular structures. Is it possible to create a similar layout without tables?