[英]custom height for active admin table td not working in rails?
在我的活動管理頁面中,我希望所有td都處於同一高度,而不是增加與內容相對應的高度。 我嘗試設置高度,但不起作用。
admin_custom.css.scss
body.active_admin {
table td{
height: 36px !important;
color: black;
width: auto;
overflow-y: hidden;
}
}
這是我的形象。 我希望我的地址顯示在一行中。 而且只有指定的寬度是可見的,並且通過單擊它我可以看到整個地址
看起來您正在使用javascript / css表顯示插件,對嗎? (我說這是因為看起來像“ order by”按鈕的小三角形)如果這樣的話,它可能會自動為列分配它認為合理的寬度。
如果顯示的是截短的版本(單擊后顯示完整的地址),那么這也可能會解決寬度問題。 我會這樣做:
<%# in the td which has the address %>
<div class="truncated-address">
<%= truncate(foo.address, length: 20) %>
<div>
<div class="full-address" style="display:none;">
<%= foo.address %>
<div>
然后將其添加到頁面上使用的javascript中-我正在jQuery中編寫此代碼,如果您不使用jQuery,則可以自己重寫它。
$(".truncated-address").click(function(){ $(this).hide().siblings().show();});
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.