Search code examples
jqueryhtmlcssslideup

Why slideUp effect doesn't work on a div that has table-row display


I'm using div for generating table display :

<div class="table-wrapper">
    <div class="table-row">
        <div class="table-cell">
            Id
        </div>
        <div class="table-cell">
            Name
        </div>
        <div class="table-cell">
            Age
        </div>
    </div>
    <div class="table-row">
        <div class="table-cell">
            1
        </div>
        <div class="table-cell">
            Joe
        </div>
        <div class="table-cell">
            25
        </div>
    </div>
    <div class="table-row">
        <div class="table-cell">
            2
        </div>
        <div class="table-cell">
            Robbin
        </div>
        <div class="table-cell">
            33
        </div>
    </div>
    <div class="table-row" id="row">
        <div class="table-cell">
            3
        </div>
        <div class="table-cell">
            Mark
        </div>
        <div class="table-cell">
            62
        </div>
    </div>
</div>

I want to my table-row has slideUp effect but it doesn't work. this jsFiddle describes my problem better.


Solution

  • DEMO

    Animations are not supported for table rows, You can use fadeIn() and fadeOut() but not animations like slideUp(), slideDown()

    Try this

    I have changed your css

    .table-wrapper{
        display:table;
    }
    .table-row{
        width:200px;
    }
    .table-cell{
        display:table-cell;
        border:1px solid gray;
        padding:5px;
        width:50px;
    }
    

    Here is a working DEMO of fadeout() without changing your table format

    Hope this helps,Thank you