Sunday 25 February 2018

Get Table columns each loop with rowIndex using jquery

<table>
                        <tbody>
                            <tr>
                                <td>
                                    first row
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    second row
                                </td>
                                <td>
                                    second row
                                </td>
                                <td>
                                    second row
                                </td>
                                <td>
                                    second row
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    third row
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    fourth row
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    fifth row
                                </td>
                            </tr>
                        </tbody>
                    </table>





/////////////////////////

   <script>
                        function GetData () {
                            $('table tr').click(function () {
                                alert(this.rowIndex);
                                $('table tr').eq(this.rowIndex).find('td').each(function () {
                                    alert($(this).html());
                                });
                            });
                        }
                    </script>



No comments:

Post a Comment

Excel Sort values in ascending order using function TEXTJOIN

 Excel ::  Text ::  1,3,5,2,9,5,11 Result :: 1,2,3,5,5,9,11 Formula ::     TEXTJOIN ( ",",1,SORT(MID(SUBSTITUTE( A1 ,","...