Why my looping create duplicate result?
<p>I want to create collapsible list (jquery mobile) by looping from javascript. From that looping I want the collapsible list get the contents from json objects. The object prop that I use for looping is <code>tipe</code>, but somehow it create a collapsible list by all <code>tipe</code> and what I want is not all <code>tipe</code> <br>(e.g. the <code>tipe</code> from json are "ESL","ESL,"ESL","UHT","UHT","WHP","WHP","WHP","WHP" , and I want to create collapsible list like "ESL","UHT","WHP") <br></p>

<p>here is what I've done so far >> <a href="http://jsfiddle.net/sevtiandy/seXmc/36/" rel="nofollow">http://jsfiddle.net/sevtiandy/seXmc/36/</a></p>

<pre><code>for (i = 0; i &lt; data[result].length; i++) {
        details +=
"&lt;div data-role='collapsible' data-collapsed='true' data-theme='b' data-content-theme='c'&gt;"+
"&lt;h3&gt;" + data[result][i].tipe + "&lt;/h3&gt;"+
"&lt;table width='100%' border='1' id='"+data[result][i].tipe+"'&gt;"+
    "&lt;tr&gt;"+
        "&lt;td rowspan='3' align='center' valign='middle' bgcolor='#CCCCCC'&gt;MARKET CHANNEL&lt;/td&gt;"+
        "&lt;td colspan='2' align='center' valign='middle' bgcolor='#CCCCCC'&gt;"+bulan3+"&lt;/td&gt;"+
        "&lt;td colspan='2' align='center' valign='middle' bgcolor='#CCCCCC'&gt;"+bulan2+"&lt;/td&gt;"+
        "&lt;td colspan='8' align='center' valign='middle' bgcolor='#CCCCCC'&gt;"+bulan1+"&lt;/td&gt;"+
    "&lt;/tr&gt;"+
    "&lt;tr&gt;"+
        "&lt;td colspan='2' align='center' valign='middle' bgcolor='#CCCCCC'&gt;ACT.&lt;/td&gt;"+
        "&lt;td colspan='2' align='center' valign='middle' bgcolor='#CCCCCC'&gt;ACT.&lt;/td&gt;"+
        "&lt;td colspan='2' align='center' valign='middle' bgcolor='#CCCCCC'&gt;PRO.&lt;/td&gt;"+
        "&lt;td colspan='2' align='center' valign='middle' bgcolor='#CCCCCC'&gt;ACT.&lt;/td&gt;"+
        "&lt;td colspan='2' align='center' valign='middle' bgcolor='#CCCCCC'&gt;BUD.&lt;/td&gt;"+
        "&lt;td colspan='2' align='center' valign='middle' bgcolor='#CCCCCC'&gt;ACV. (%)&lt;/td&gt;"+
    "&lt;/tr&gt;"+
    "&lt;tr&gt;"+
        "&lt;td align='center' valign='middle' bgcolor='#CCCCCC'&gt;VAL&lt;/td&gt;"+
        "&lt;td align='center' valign='middle' bgcolor='#CCCCCC'&gt;%&lt;/td&gt;"+
        "&lt;td align='center' valign='middle' bgcolor='#CCCCCC'&gt;VAL&lt;/td&gt;"+
        "&lt;td align='center' valign='middle' bgcolor='#CCCCCC'&gt;%&lt;/td&gt;"+
        "&lt;td align='center' valign='middle' bgcolor='#CCCCCC'&gt;VAL&lt;/td&gt;"+
        "&lt;td align='center' valign='middle' bgcolor='#CCCCCC'&gt;%&lt;/td&gt;"+
        "&lt;td align='center' valign='middle' bgcolor='#CCCCCC'&gt;VAL&lt;/td&gt;"+
        "&lt;td align='center' valign='middle' bgcolor='#CCCCCC'&gt;QTY&lt;/td&gt;"+
        "&lt;td align='center' valign='middle' bgcolor='#CCCCCC'&gt;VAL&lt;/td&gt;"+
        "&lt;td align='center' valign='middle' bgcolor='#CCCCCC'&gt;QTY&lt;/td&gt;"+
        "&lt;td align='center' valign='middle' bgcolor='#CCCCCC'&gt;VAL&lt;/td&gt;"+
        "&lt;td align='center' valign='middle' bgcolor='#CCCCCC'&gt;QTY&lt;/td&gt;"+
    "&lt;/tr&gt;"+    
"&lt;/table&gt;"+
"&lt;/div&gt;";
    }

    $("#tipe_" + kodenegara)
        .empty()
        .append(details)
        .trigger('create');
    $("#tipe_" + kodenegara).ready(function() {
        $('table.alt tr:odd').addClass('odd');
        $('table.alt tr:even').addClass('even');
    });
</code></pre>

<p>here is the array:</p>

<pre><code>"GetReportIdResult": [
    {
      "act_qty1": "834",
      "act_val1": "11",
      "acvqty": "0.99",
      "acvval": "0.84",
      "budqty": "84332",
      "budval": "1315",
      "bulan1": "7",
      "bulan2": "6 ",
      "bulan3": "5 ",
      "cm_per1": "21.9",
      "cm_per2": "31.8",
      "cm_per3": "29.2",
      "cm_val1": "2",
      "cm_val2": "206",
      "cm_val3": "356",
      "mc": "Agen",
      "tipe": "ESL"
    },
    {
      "act_qty1": "17076",
      "act_val1": "186",
      "acvqty": "36.01",
      "acvval": "38.64",
      "budqty": "47416",
      "budval": "482",
      "bulan1": "7 ",
      "bulan2": "6 ",
      "bulan3": "5 ",
      "cm_per1": "8.6",
      "cm_per2": "7.0",
      "cm_per3": "8.1",
      "cm_val1": "16",
      "cm_val2": "47",
      "cm_val3": "54",
      "mc": "Hotel &amp; Restaurant",
      "tipe": "ESL"
    },
    {
      "act_qty1": "30948",
      "act_val1": "299",
      "acvqty": "16.48",
      "acvval": "16.22",
      "budqty": "187788",
      "budval": "1841",
      "bulan1": "7 ",
      "bulan2": "6 ",
      "bulan3": "5 ",
      "cm_per1": "-3.2",
      "cm_per2": "-3.1",
      "cm_per3": "-3.1",
      "cm_val1": "-10",
      "cm_val2": "-61",
      "cm_val3": "-55",
      "mc": "Institution",
      "tipe": "ESL"
    },
    {
      "act_qty1": "8358",
      "act_val1": "121",
      "acvqty": "37.96",
      "acvval": "35.26",
      "budqty": "22019",
      "budval": "342",
      "bulan1": "7 ",
      "bulan2": "6 ",
      "bulan3": "5 ",
      "cm_per1": "26.7",
      "cm_per2": "28.4",
      "cm_per3": "30.1",
      "cm_val1": "32",
      "cm_val2": "128",
      "cm_val3": "155",
      "mc": "Lower Trade",
      "tipe": "ESL"
    },
    {
      "act_qty1": "53433",
      "act_val1": "943",
      "acvqty": "19.45",
      "acvval": "19.48",
      "budqty": "274742",
      "budval": "4844",
      "bulan1": "7 ",
      "bulan2": "6 ",
      "bulan3": "5 ",
      "cm_per1": "31.2",
      "cm_per2": "31.2",
      "cm_per3": "31.2",
      "cm_val1": "295",
      "cm_val2": "1423",
      "cm_val3": "1567",
      "mc": "Modern Market",
      "tipe": "ESL"
    },
    {
      "act_qty1": "0",
      "act_val1": "0",
      "acvqty": "0.00",
      "acvval": "0.00",
      "budqty": "732",
      "budval": "13",
      "bulan1": "7 ",
      "bulan2": "6 ",
      "bulan3": "5 ",
      "cm_per1": "0.0",
      "cm_per2": "34.5",
      "cm_per3": "34.8",
      "cm_val1": "0",
      "cm_val2": "9",
      "cm_val3": "15",
      "mc": "Agen",
      "tipe": "ESL500ML"
    },
    {
      "act_qty1": "156",
      "act_val1": "3",
      "acvqty": "0.00",
      "acvval": "0.00",
      "budqty": "0",
      "budval": "0",
      "bulan1": "7 ",
      "bulan2": "6 ",
      "bulan3": "5 ",
      "cm_per1": "33.0",
      "cm_per2": "33.2",
      "cm_per3": "33.3",
      "cm_val1": "1",
      "cm_val2": "2",
      "cm_val3": "4",
      "mc": "Hotel &amp; Restaurant",
      "tipe": "ESL500ML"
    },
    {
      "act_qty1": "90",
      "act_val1": "2",
      "acvqty": "20.11",
      "acvval": "21.33",
      "budqty": "448",
      "budval": "8",
      "bulan1": "7 ",
      "bulan2": "6 ",
      "bulan3": "5 ",
      "cm_per1": "39.4",
      "cm_per2": "32.8",
      "cm_per3": "37.8",
      "cm_val1": "1",
      "cm_val2": "1",
      "cm_val3": "2",
      "mc": "Lower Trade",
      "tipe": "ESL500ML"
    },
    {
      "act_qty1": "3535",
      "act_val1": "68",
      "acvqty": "20.57",
      "acvval": "20.63",
      "budqty": "17189",
      "budval": "331",
      "bulan1": "7 ",
      "bulan2": "6 ",
      "bulan3": "5 ",
      "cm_per1": "39.7",
      "cm_per2": "40.8",
      "cm_per3": "40.3",
      "cm_val1": "27",
      "cm_val2": "140",
      "cm_val3": "166",
      "mc": "Modern Market",
      "tipe": "ESL500ML"
    },
    {
      "act_qty1": "2700",
      "act_val1": "29",
      "acvqty": "2.84",
      "acvval": "3.27",
      "budqty": "95040",
      "budval": "899",
      "bulan1": "7 ",
      "bulan2": "6 ",
      "bulan3": "5 ",
      "cm_per1": "9.5",
      "cm_per2": "11.1",
      "cm_per3": "12.9",
      "cm_val1": "3",
      "cm_val2": "76",
      "cm_val3": "74",
      "mc": "Agen",
      "tipe": "UHT"
    },
    {
      "act_qty1": "3216",
      "act_val1": "35",
      "acvqty": "18.93",
      "acvval": "19.03",
      "budqty": "16993",
      "budval": "184",
      "bulan1": "7 ",
      "bulan2": "6 ",
      "bulan3": "5 ",
      "cm_per1": "10.8",
      "cm_per2": "7.6",
      "cm_per3": "6.6",
      "cm_val1": "4",
      "cm_val2": "9",
      "cm_val3": "9",
      "mc": "Hotel &amp; Restaurant",
      "tipe": "UHT"
    },
    {
      "act_qty1": "10701",
      "act_val1": "105",
      "acvqty": "23.85",
      "acvval": "24.15",
      "budqty": "44872",
      "budval": "434",
      "bulan1": "7 ",
      "bulan2": "6 ",
      "bulan3": "5 ",
      "cm_per1": "1.4",
      "cm_per2": "-0.6",
      "cm_per3": "-0.5",
      "cm_val1": "1",
      "cm_val2": "-3",
      "cm_val3": "-2",
      "mc": "Institution",
      "tipe": "UHT"
    },
    {
      "act_qty1": "5663",
      "act_val1": "65",
      "acvqty": "18.58",
      "acvval": "19.33",
      "budqty": "30487",
      "budval": "334",
      "bulan1": "7 ",
      "bulan2": "6 ",
      "bulan3": "5 ",
      "cm_per1": "12.7",
      "cm_per2": "12.0",
      "cm_per3": "11.2",
      "cm_val1": "8",
      "cm_val2": "36",
      "cm_val3": "40",
      "mc": "Lower Trade",
      "tipe": "UHT"
    },
    {
      "act_qty1": "16637",
      "act_val1": "197",
      "acvqty": "18.60",
      "acvval": "18.38",
      "budqty": "89424",
      "budval": "1072",
      "bulan1": "7 ",
      "bulan2": "6 ",
      "bulan3": "5 ",
      "cm_per1": "9.3",
      "cm_per2": "7.4",
      "cm_per3": "11.8",
      "cm_val1": "18",
      "cm_val2": "68",
      "cm_val3": "133",
      "mc": "Modern Market",
      "tipe": "UHT"
    },
    {
      "act_qty1": "84",
      "act_val1": "3",
      "acvqty": "2.10",
      "acvval": "2.10",
      "budqty": "4008",
      "budval": "132",
      "bulan1": "7 ",
      "bulan2": "6 ",
      "bulan3": "5 ",
      "cm_per1": "50.9",
      "cm_per2": "52.9",
      "cm_per3": "51.0",
      "cm_val1": "1",
      "cm_val2": "3",
      "cm_val3": "110",
      "mc": "Agen",
      "tipe": "WHP"
    },
    {
      "act_qty1": "948",
      "act_val1": "30",
      "acvqty": "26.33",
      "acvval": "27.82",
      "budqty": "3600",
      "budval": "108",
      "bulan1": "7 ",
      "bulan2": "6 ",
      "bulan3": "5 ",
      "cm_per1": "48.9",
      "cm_per2": "50.5",
      "cm_per3": "41.2",
      "cm_val1": "15",
      "cm_val2": "63",
      "cm_val3": "76",
      "mc": "Hotel &amp; Restaurant",
      "tipe": "WHP"
    },
    {
      "act_qty1": "2604",
      "act_val1": "71",
      "acvqty": "9.18",
      "acvval": "9.28",
      "budqty": "28360",
      "budval": "769",
      "bulan1": "7 ",
      "bulan2": "6 ",
      "bulan3": "5 ",
      "cm_per1": "43.3",
      "cm_per2": "42.9",
      "cm_per3": "39.3",
      "cm_val1": "31",
      "cm_val2": "233",
      "cm_val3": "358",
      "mc": "Institution",
      "tipe": "WHP"
    },
    {
      "act_qty1": "6",
      "act_val1": "0",
      "acvqty": "3.33",
      "acvval": "4.26",
      "budqty": "180",
      "budval": "6",
      "bulan1": "7 ",
      "bulan2": "6 ",
      "bulan3": "5 ",
      "cm_per1": "60.4",
      "cm_per2": "0.0",
      "cm_per3": "0.0",
      "cm_val1": "0",
      "cm_val2": "0",
      "cm_val3": "0",
      "mc": "Lower Trade",
      "tipe": "WHP"
    },
    {
      "act_qty1": "266",
      "act_val1": "11",
      "acvqty": "50.38",
      "acvval": "50.51",
      "budqty": "528",
      "budval": "21",
      "bulan1": "7 ",
      "bulan2": "6 ",
      "bulan3": "5 ",
      "cm_per1": "48.6",
      "cm_per2": "48.8",
      "cm_per3": "49.2",
      "cm_val1": "5",
      "cm_val2": "14",
      "cm_val3": "17",
      "mc": "Modern Market",
      "tipe": "WHP"
    },
    {
      "act_qty1": "0",
      "act_val1": "0",
      "acvqty": "0.00",
      "acvval": "0.00",
      "budqty": "0",
      "budval": "0",
      "bulan1": "7 ",
      "bulan2": "6 ",
      "bulan3": "5 ",
      "cm_per1": "0.0",
      "cm_per2": "5.1",
      "cm_per3": "5.5",
      "cm_val1": "0",
      "cm_val2": "9",
      "cm_val3": "6",
      "mc": "Agen",
      "tipe": "CHEESE1K"
    },
    {
      "act_qty1": "127",
      "act_val1": "8",
      "acvqty": "0.98",
      "acvval": "0.98",
      "budqty": "13000",
      "budval": "845",
      "bulan1": "7 ",
      "bulan2": "6 ",
      "bulan3": "5 ",
      "cm_per1": "21.2",
      "cm_per2": "21.7",
      "cm_per3": "22.8",
      "cm_val1": "2",
      "cm_val2": "33",
      "cm_val3": "40",
      "mc": "Hotel &amp; Restaurant",
      "tipe": "CHEESE1K"
    },
    {
      "act_qty1": "0",
      "act_val1": "0",
      "acvqty": "0.00",
      "acvval": "0.00",
      "budqty": "0",
      "budval": "0",
      "bulan1": "7 ",
      "bulan2": "6 ",
      "bulan3": "5 ",
      "cm_per1": "0.0",
      "cm_per2": "19.8",
      "cm_per3": "0.0",
      "cm_val1": "0",
      "cm_val2": "0",
      "cm_val3": "0",
      "mc": "Lower Trade",
      "tipe": "CHEESE1K"
    },
    {
      "act_qty1": "0",
      "act_val1": "0",
      "acvqty": "0.00",
      "acvval": "0.00",
      "budqty": "0",
      "budval": "0",
      "bulan1": "7 ",
      "bulan2": "6 ",
      "bulan3": "5 ",
      "cm_per1": "0.0",
      "cm_per2": "19.0",
      "cm_per3": "0.0",
      "cm_val1": "0",
      "cm_val2": "0",
      "cm_val3": "0",
      "mc": "Modern Market",
      "tipe": "CHEESE1K"
    }
  ]
}
</code></pre>

<p>and one more thing, in my collapsible list, there is a table and I want to create "zebra strip" for row backgound, how to do that?</p>

<p>Thanks</p>
