基于输入字段对html表进行排序

时间:2018-05-02 03:34:37

标签: php html-table

我需要根据输入字段对表进行排序。我想避免重新加载表数据,这就是为什么我只想对表进行排序。有没有办法做到这一点?

这是我的代码:

<div class=buyer_list>
    <div class='ui-grid grid-buyer_list'>
        <div class="buyer_opt" >
            <span>Search By:</span>
            <?php echo '
            <input type="text" method="POST" id="searchdata" name="searchdata">
            <button name="submit" type="submit" id="submit" name="buyer_btnsearch" type="text" onclick="return search_onlookup()" style="display: inline;"> Search</button>'; ?>
        </div>
        <div class=buyer_list>
            <div class='ui-grid grid-buyer_list'>
                <div class='ui-rowheader'></div>
                <div class="ui-rowlist">
                <?php while($rs1=mysql_fetch_array($result1)):?>
                    <div class="ui-rowdata" onclick="clckrow(this);"> 
                        <div class='ui-coldata col D buyercode'><?php echo $rs1['buyercode'];?></div>
                        <div class='ui-coldata col D unitcode'><?php echo $rs1['unitcode'];?></div>
                        <div class='ui-coldata col D buyername'><?php echo $rs1['buyername'];?></div>
                        <div class='ui-coldata col D tcp'><?php echo $rs1['TCP'];?></div>
                        <div class='ui-coldata col D tcppaid'><?php echo $rs1['TCPPaid'];?></div>
                        <div class='ui-coldata col D tcpperc'><?php echo $rs1['TCPpercPaid'];?></div>
                        <div class='ui-coldata col D bal'><?php echo $rs1['balance'];?></div>
                        <div class='ui-coldata col D print'>NO</div>
                    </div>
                <?php endwhile;?>  
            </div>
        </div>
    </div>

0 个答案:

没有答案