UserScript that summarizes Stack Exchange flag counts
I don't particularly have an issue with your HTML, however your JavaScript could be improved.

Currently, you have a lot of duplicate logic. You should move it to a function that each case can call.

Like the following:

function flagCount(selector){
    var count = 0;
    $(selector).parent().prev().each(function () {
        count += parseInt($(this).text().replace(",", ""));
    });
    return count;
}



If I pass 0 into parseInt without the second parameter, it will return a hex number...


Using Number is better, and more readable.

Leaving you totally with:

function flagCount(selector){
    var count = 0;
    $(selector).parent().prev().each(function () {
        count += Number($(this).text().replace(",", ""));
    });
    return count;
}
var helpful = flagCount("td &gt; a:contains('helpful')");
var declined = flagCount("td &gt; a:contains('declined')");
var disputed = flagCount("td &gt; a:contains('disputed')");
var aged = flagCount("td &gt; a:contains('aged')");
var total = flagCount("td &gt; a:contains('flags')");


Note, you could string concatenate the selector inside the function, but that limits the use case that you select another DOM element.