Отзывчивые изображения в таблицах (бутстрап 3)

Я использую Bootstrap 3 Framework и имею некоторые проблемы с "img-отзывчивый" класс в Firefox. У меня есть стол с 4 колонками с макетом 15/50/10/25%. В первом столбце находится большое изображение, которое должно быть уменьшено до 15%. Но это работает только в Chrome/Opera, но не в FF/IE (изображения не реагируют и поэтому слишком большие).

Мой код:

<table class="table table-striped table-condensed voc_list ">

<thead>
<tr>
<th style="width:15%;"></th>
<th style="width:50%;">Bezeichnung</th>
<th style="width:10%;">Zeitraum</th>
<th style="width:25%;">Ort</th>
</tr>
</thead>

<tbody>

<tr class="listview">
<td style="padding:15px 0px 15px 0px;"> 
<a href="xy" title="">
<img src="yx.jpg" class="img-responsive voc_list_preview_img" alt="" title=""></a>
</td>

<td style="width: 50%; padding:15px 15px 15px 15px;">
<a href="xy" title="">
<h3 class="nomargin_top">ABC</h3>
</a>
</td>

<td style="width:10%;">
555
</td>

<td>
XYZ
</td>

</tbody>

</table>

Является ли это известной проблемой в BS3? Я ничего не мог найти.

Изменить: http://jsfiddle.net/cctyb/ - в Chrome это работает, в FF изображение будет большим

Ответы

Ответ 2

У меня также была эта проблема, решение для меня было "исправлено табличное оформление"

.table-container {
    display: table;
    table-layout: fixed;
    width: 100%;
    height: 100%;
}
.table-cell-container {
    text-align: left;
    display: table-cell;
    vertical-align: middle;
    &.center{
        text-align: center;
    }
    img{
        display: inline-block;
        width: auto;
        max-width: 100%;
        height: auto;
        max-height: 100%;

    }
}

<div class="table-container">
<div class="table-cell-container center">
         <img src="myimage.jpg" width="100" height="100" alt="myimage" />
</div>
</div>

Ответ 3

Ответ от Bass

.img-responsive {
   width:100%;
}

работает, но он также масштабирует другие изображения.

Вместо этого я создал другой класс как

.img-responsive-2 { 
   width: 100%; 
}

и поместите его вместе с оригиналом .img-responsive, чтобы я мог использовать его только для изображений в таблицах.

<img src="someimage.jpg" class="img-responsive img-responsive-2" />

Ответ 4

Попробуйте этот код

$(window).load(function() {
    $('img.img-responsive').each(function(){
        // Remember image size
        var imgWidth = $(this).width();
        // hide image 
        $(this).hide();
        // if container width < image width, we add width:100% for image 
        if ( $(this).parent().width() < imgWidth ) { $(this).css('width', '100%'); }
        // show image
        $(this).show();
    });
});

Ответ 5

Мой пользовательский css:

table .img-responsive {
    width: 100%;
}