Hi as you can see below I am using ruby to automate an xls creation process, but unfortunately when the xls document is created a small style error occurs. This shows in the checkboxes where the first few are too big as you can see in the image below.
also here is the code of the xls table:
<table border="1" width="100px">
<tr>
<th></th>
<th colspan="32">Hours of rest record</th>
<th colspan="16">Crew Members Name</th>
<th colspan="1"></th>
<th colspan="2"><%= @crewmember.user.full_name %></th>
</tr>
<tr>
<th></th>
<th colspan="48">Work hours (Place and 'x' in each half hour worked and count hours of rest)</th>
<th colspan="1">Start Date</th>
<th colspan="2"><%= @shifts.first.day %></th>
</tr>
<tr>
<th colspan="1">Hours / date</th>
<th colspan="2">0030</th>
<th colspan="2">0130</th>
<th colspan="2">0230</th>
<th colspan="2">0330</th>
<th colspan="2">0430</th>
<th colspan="2">0530</th>
<th colspan="2">0630</th>
<th colspan="2">0730</th>
<th colspan="2">0830</th>
<th colspan="2">0930</th>
<th colspan="2">1030</th>
<th colspan="2">1130</th>
<th colspan="2">1230</th>
<th colspan="2">1330</th>
<th colspan="2">1430</th>
<th colspan="2">1530</th>
<th colspan="2">1630</th>
<th colspan="2">1730</th>
<th colspan="2">1830</th>
<th colspan="2">1930</th>
<th colspan="2">2030</th>
<th colspan="2">2130</th>
<th colspan="2">2230</th>
<th colspan="2">2330</th>
<th colspan="1">Hours of rest</th>
<th colspan="2">Comment</th>
</tr>
<% @shifts.each do |shift| %>
<tr>
<td><%= shift.day %></td>
<td><%= shift.hour_0000_to_0029 %></td>
<td><%= shift.hour_0030_to_0059 %></td>
<td><%= shift.hour_0100_to_0129 %></td>
<td><%= shift.hour_0130_to_0159 %></td>
<td><%= shift.hour_0200_to_0229 %></td>
<td><%= shift.hour_0230_to_0259 %></td>
<td><%= shift.hour_0300_to_0329 %></td>
<td><%= shift.hour_0330_to_0359 %></td>
<td><%= shift.hour_0400_to_0429 %></td>
<td><%= shift.hour_0430_to_0459 %></td>
<td><%= shift.hour_0500_to_0529 %></td>
<td><%= shift.hour_0530_to_0559 %></td>
<td><%= shift.hour_0600_to_0629 %></td>
<td><%= shift.hour_0630_to_0659 %></td>
<td><%= shift.hour_0700_to_0729 %></td>
<td><%= shift.hour_0730_to_0759 %></td>
<td><%= shift.hour_0800_to_0829 %></td>
<td><%= shift.hour_0830_to_0859 %></td>
<td><%= shift.hour_0900_to_0929 %></td>
<td><%= shift.hour_0930_to_0959 %></td>
<td><%= shift.hour_1000_to_1029 %></td>
<td><%= shift.hour_1030_to_1059 %></td>
<td><%= shift.hour_1100_to_1129 %></td>
<td><%= shift.hour_1130_to_1159 %></td>
<td><%= shift.hour_1200_to_1229 %></td>
<td><%= shift.hour_1230_to_1259 %></td>
<td><%= shift.hour_1300_to_1329 %></td>
<td><%= shift.hour_1330_to_1359 %></td>
<td><%= shift.hour_1400_to_1429 %></td>
<td><%= shift.hour_1430_to_1459 %></td>
<td><%= shift.hour_1500_to_1529 %></td>
<td><%= shift.hour_1530_to_1559 %></td>
<td><%= shift.hour_1600_to_1629 %></td>
<td><%= shift.hour_1630_to_1659 %></td>
<td><%= shift.hour_1700_to_1729 %></td>
<td><%= shift.hour_1730_to_1759 %></td>
<td><%= shift.hour_1800_to_1829 %></td>
<td><%= shift.hour_1830_to_1859 %></td>
<td><%= shift.hour_1900_to_1929 %></td>
<td><%= shift.hour_1930_to_1959 %></td>
<td><%= shift.hour_2000_to_2029 %></td>
<td><%= shift.hour_2030_to_2059 %></td>
<td><%= shift.hour_2100_to_2129 %></td>
<td><%= shift.hour_2130_to_2159 %></td>
<td><%= shift.hour_2200_to_2229 %></td>
<td><%= shift.hour_2230_to_2259 %></td>
<td><%= shift.hour_2300_to_2329 %></td>
<td><%= shift.hour_2330_to_2359 %></td>
<td colspan="1" style="text-align:center;"><%= shift.hours_of_rest %></td>
<td colspan="2"><%= shift.time_profile_id %></td>
</tr>
<% end %>
</table>
<br/><br/>
<table border="1">
<tr>
<th>Approved By:</th>
<th>Hours of Rest Record:</th>
<th>Version</th>
<th>Last Review</th>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
<br/>
<table border="0">
<tr>
<td>Crew Member Signiture</td>
<td style="width:200px; border-bottom: 0.5px dotted black"></td>
</tr>
<tr><td></td></tr>
<tr>
<td>Master Signiture</td>
<td style="width:200px; border-bottom: 0.5px dotted black"></td>
</tr>
</table>
another note is that when I remove all the tables but the very top table it seems to fix it.
Thank you in advance
No comments:
Post a Comment