javascript - Multiple tbodys and scroll inside the 1st & column width issue -
im'm trying scrollable first tbody inside table fixed header, divided in 4 tbodies witch : http://scr.hu/0ei9/k2tqx here's fiddle https://jsfiddle.net/yb5sob07/ (sorry html it's lot of code generated angular , difficult clean fiddle...)
in short looks :
<table class="planning shifts"> <thead> <!-- les jours du mois--> <tr class="bg-active"> <th>coursier|jour</th> <th class="monthday">days 1 31 </th> </tr> </thead> <tbody id="shiftstable"> <tr> <td class="coursiertd"> <a href="#">{{user.name}}</a> </td> <td>user/day </td> </tr> </tbody> <tbody ng-repeat="city in cities"> <tr class="citymanquesheader"> <th colspan="{{calendar.monthdays.length+1}}"> lausanne </th> </tr> <tr> <td> manques </td> <td>days</td> </tr> </tbody> <tbody> <tr> <tr class="citymanquesheader" ng-click="slidemanques($event)"> <th colspan="{{calendar.monthdays.length+1}}">doublons</th> </tr> <tr> <td>doublons</td> <td>days</td> </tbody> </table>
for css can summarized this:
.planning.shifts{ //<table> selector table-layout: fixed; tbody:first-of-type { display: block; overflow: auto; width: 10000%; height: 300px; } thead:first-of-type { tr { display: block; position: relative; } } th, td { text-align: center; } td:nth-child(1), th:nth-child(1) { width: 110px; } td:nth-child(2), th:nth-child(2){ width: 50px; } td:nth-child(3), th:nth-child(3) { width: 40px; } }
as can see there several problems. tbody scroll nothing matches cells' , column's widths.
with display:block loose colored columns. , don't understand why had set width 10000% can see in first tbody, in other case stay tiny, not width of first column.
also, has consequences on tbodies beneath, first columns seems passed through. nth-child seems work first occurence of each child (for 1st one, 2nd 1 , 3rn, not further).
i tried plugins datatables , ok, if not fact, (if @ day 25) columns may larger others , width isn't taken account other lower tbodies, , should (something works if there no display:block).
well, lot of problems...any ideas how work out?
Comments
Post a Comment