HAML:表列的宽度不起作用
没有什么不工作。当我输入大型文本表时,会向右深入并出现水平导航。
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%;}
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%;}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你确实想设置样式,而不是 html 属性
试试这个:
你实际创建的是:
你应该创建:
当然,使用类和 CSS 会更好,但这将解决眼前的问题。
You really want to set the style, not html attributes
Try this:
What you're actually creating is:
And you should be creating:
of course, using classes and CSS would be better, but this will solve immediate concern.