I need help with centering a +/- animation within my table rows to create an accordion toggle effect for revealing more information. Despite finding a nice looking animation, I'm struggling to position it correctly within the td element in my code. Here is what I have so far:
<tr ng-repeat="item in c.list track by $index" ng-if="$index >= data.window_start && $index < data.window_end">
<td>
<div ng-class="{'accordion-toggle collapsed':item.work_history_type == 'Uniformed Service'}" data-toggle="collapse" href="#{{item.sys_id}}" role="button" aria-expanded="false" aria-controls="collapseDetails"></div>
</td>
<td>{{item.work_history_type}}
</td>
<td>{{item.work_name}}
<div id="{{item.sys_id}}" class="collapse">
<div ng-repeat="item2 in c.list2 | filter: {'uni' : item.sys_id}">
<span ng-click="c.newEntry(item2.sys_id, 'campaign_table','newWork')"class="h4 edit" >{{item2.camp}}: From: {{item2.from}} To: {{item2.to}}</span>
</div>
</div>
</td>
<td>{{item.from}}</td>
<td>{{item.to}}</td>
</tr>
My current CSS code is as follows:
.accordion-toggle {
position: relative;
}
.accordion-toggle::before,
.accordion-toggle::after {
content: '';
display: block;
position: absolute;
width: 12px;
height: 2px;
background-color: $color-darkest;
-webkit-transform-origin: 50% 50%;
-ms-transform-origin: 50% 50%;
transform-origin: 50% 50%;
-webkit-transition: all 0.25s;
transition: all 0.25s;
}
.accordion-toggle::before {
-webkit-transform: rotate(-90deg);
-ms-transform: rotate(-90deg);
transform: rotate(-90deg);
opacity: 0;
}
.accordion-toggle.collapsed::before {
-webkit-transform: rotate(0deg);
-ms-transform: rotate(0deg);
transform: rotate(0deg);
opacity: 1;
}
.accordion-toggle.collapsed::after {
-webkit-transform: rotate(-90deg);
-ms-transform: rotate(-90deg);
transform: rotate(-90deg);
}
.accordion-toggle > span {
margin-left: 20px;
}
The issue persists and can be seen in this screenshot: https://i.stack.imgur.com/bwuWJ.png
If anyone has any suggestions on how to properly align the plus signs in the accordion toggle, I would greatly appreciate it. Thank you!