views:

20

answers:

0

Hello, I have a table setup like this:

<table id="product_table">
    <thead>
        <tr>
            <th>Name</th>
            <th>Bandwidth</th>
            <th>Price</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>Name #1 (works fine)</td>
            <td>Technology<br /><span>3000</span> / 600</td>
            <td>99,- (this works fine as well)</td>
        </tr>
        <tr>
            <td>Name #2</td>
            <td>Technology<br />&nbsp;</td>
            <td>199,-</td>
        <tr>
    </tbody>
</table>

As you can see, the data in the second data-cell isn't consistant. This is just an example, the table of course contains more rows.

Here's how I setup the tablesorter;

$('#product_table').tablesorter({
    debug: true,
    headers: { 
        0:{sorter: 'text'},
        1:{sorter: 'integer'},
        2:{sorter: 'digit'}
    },
    textExtractionCustom: {
        1: function(o) {
            return $('span',o).text();
        }
    }
});

Still it doesn't sort it correct, according to the values it is supposed to gather from the span-tags. I've tried setting the sorter method to digit as well, but integer seems to work better. Any help would be appreciated :)