使用從http://datatables.net/的數據表,我怎樣才能阻止它在頁面上溢出? 寬度問題從http://datatables.net/
編輯:
<script type="text/javascript">
$(document).ready(function() {
$('#comment').dataTable({
"oLanguage": {
"sInfo": "",
"sInfoEmpty": "",
"sInfoFiltered": ""
},
"sPaginationType": "full_numbers",
"iDisplayLength": 5,
"bLengthChange": false,
"aaSorting": [[3, 'desc']],
"aoColumns": [
{ "bSortable": false },
null,
null,
{ "asSorting": [ "desc" ] },
null,
{ "bSortable": false }
] });
});
</script>
<table id="comment">
<thead>
<tr>
<th></th>
<th>Name</th>
<th>Comment</th>
<th>Created</th>
<th>Attachments</th>
<th><center>Delete?</center></th>
</tr>
</thead>
<tbody>
<% @company.comments.each do |comment| %>
<tr>
<td>
<% if comment.user.avatar.blank? %>
<%= image_tag("default_user.png", :height => "50", :width => "50") %>
<% else %>
<%= image_tag(comment.user.avatar_url, :height => "50", :width => "50") %>
<% end %>
</td>
<% if comment.user.name.nil? %>
<td><%= comment.user.email %></td>
<% else %>
<td><%= comment.user.name %></td>
<% end %>
<td><%=raw comment.body %></td>
<td><%= comment.created_at.to_s(:db) %></td>
<% if comment.file.blank? %>
<td></td>
<% else %>
<td><%= link_to comment.file_identifier, comment.file_url %></td>
<% end %>
<td><center><%= link_to image_tag("delete.png", :alt => "Delete", :height => "15px"), [comment.company, comment], :confirm => 'Are you sure?', :method => :delete %></center></td>
</tr>
<% end %>
</tbody>
</table>
向我們展示您的html和js – 2012-03-22 09:15:40
編輯的代碼 – ahmet 2012-03-22 09:23:06