summaryrefslogtreecommitdiff
path: root/app/views/memory/table.html.erb
blob: 03f1ef249e44693444b484ac1b1dc55ff10fa57b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<table class="memory-table", data-project="<%=params[:project]%>">
  <tr>
    <% ["Address","0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"].each do |i| %>
      <th><b><%=i%></b></th>
    <% end %>
  </tr>
  <% @data.in_groups_of(16).each_with_index do |row, rindex| %>
    <tr>
      <td><b><%=(rindex*16).to_s(16).upcase.rjust(6, "0")%></b></td>
      <% row.each_with_index do |hex, hindex| %>
        <td contenteditable="<%=@can_edit%>" id="memory-<%=(16*rindex)+hindex%>"><%=hex.to_s.upcase.rjust(2, "0")%></td>
      <% end %>
    </tr>
  <% end %>
</table>
<br>