Search row with highest number of cells in a row with colspan

Posted by user593029 on Stack Overflow See other posts from Stack Overflow or by user593029
Published on 2012-09-18T20:41:58Z Indexed on 2012/09/19 9:38 UTC
Read the original article Hit count: 222

Filed under:
|

What is the efficient way to search highest number of cells in big table with numerous colspan (merge cells ** colspan should be ignored so in below example highest number of cells is 4 in first row). Is it js/jquery with reg expression or just the loop with bubble sorting. I got one link as below explainig use of regex is it ideal way ... can someone suggest pseudo code for this.

High cpu consumption due to a jquery regex patch

<table width="156" height="84" border="0" >
    <tbody>
        <tr style="height:10px">
            <td width="10" style="width:10px; height:10px"/>
            <td width="10" style="width:10px; height:10px"/>
            <td width="10" style="width:10px; height:10px"/>
            <td width="10" style="width:10px; height:10px"/>
        </tr>
        <tr style="height:10px">
            <td width="10" style="width:10px; height:10px" colspan="2"/>
            <td width="10" style="width:10px; height:10px"/>
            <td width="10" style="width:10px; height:10px"/>
        </tr>
        <tr style="height:10px">
            <td width="10" style="width:10px; height:10px"/>
            <td width="10" style="width:10px; height:10px"/>
            <td width="10" style="width:10px; height:10px" colspan="2"/>
        </tr>
        <tr style="height:10px">
            <td width="10" style="width:10px; height:10px" colspan="2"/>
            <td width="10" style="width:10px; height:10px"/>
            <td width="10" style="width:10px; height:10px"/>
        </tr>
    </tbody>
</table>

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery