Nothing from this not working. When I typing large text table going deep right and horizontal nav appears.
index.haml
%table{:border => 1, :width => "100%"}
%tr
%th{:width => "200"} Name
%th.edit Edit
- @wallpapers.each do |wallpaper|
%tr
%td.name= wallpaper.name
%td= link_to (image_tag wallpaper.thumb.url(:thumb)), edit_wallpaper_path(wallpaper)
%td= button_to 'Delete', wallpaper_path(wallpaper), :confirm => 'Are you sure you want to delete this wallpaper?', :method => :delete
style.css
th.edit {width:20%;}
td.name {width:20%;}
You really want to set the style, not html attributes
Try this:
%table{:style=>"border: 1px; width: 100%"}
What you're actually creating is:
<table border="1" width="100%">
And you should be creating:
<table style="border: 1px; width: 100%">
of course, using classes and CSS would be better, but this will solve immediate concern.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With