问:
How to read a class then a child class?
I am trying to find all the value in a child class using javascript (jquery). I am unable to pinpoint the issue using developer tool. I uploaded the HTML, javascript, and CSS FIDDLE

Just wanted to see what am I missing from my code that it doesn't even trigger the sample alert I have right after the loop of the parent-child code. HTML is here and in the fiddle. the alert should show Cost (1)

```<code></tr><tr class="ms-gb" lgrp="1"><td style="padding-left: 0px;" colspan="7"><a href="javascript:"><img id="lt_expandCollapseImage" onclick="_lt_LTGridViewExpandCollapseA(this.parentNode);" alt="Cost" src="/_layouts/15/images/plus.gif" border="0"></a> <span style="cursor: pointer;" onclick="_lt_LTGridViewExpandCollapseA(this);">Cost (1)</span></td></tr>

$(document).ready(function(){
    $(".ms-listviewtable td[class^='ms-gb']").each(function(){
      var mydiv = document.getElementsByClassName("nav-report-category")[0];
      var liTag = document.createElement('li');
      var aTag = document.createElement('a');
      var str = $(this).find("span:last");
      alert(str);
</code>```

$(document).ready(function() {
  $(".ms-listviewtable .tr[class='ms-gb']").each(function() {
    alert('test');
    var mydiv = document.getElementsByClassName("nav-report-category")[0];
    var liTag = document.createElement('li');
    var aTag = document.createElement('a');

    var str = $(this).find("span:last");
    alert(str);
    //var str = $(this).text();
    str = str.substring(str.indexOf(":") + 1); //remove everything before :
    str = str.substring(0, str.indexOf("(")); //remove counts

    if (!str.trim() || str.trim() == null) {
      liTag = document.createElement('li');
      aTag = document.createElement('a');
      aTag.innerHTML = "Other";
      var link = window.location.href + "&RC=" + str.trim();
    } else {
      liTag = document.createElement('li');
      aTag = document.createElement('a');
      aTag.innerHTML = str.trim();
      var link = window.location.href + "&RC=" + str.trim();
    }

    aTag.setAttribute('target', '_blank');
    aTag.setAttribute("href", link);

    liTag.appendChild(aTag);
    mydiv.appendChild(liTag);
  });
});```
<pre class="snippet-code-css lang-css prettyprint-override"><code>.nav-report-category {
  border: none !important;
}

.nav-report-category li {
  font-size: 16px;
  padding: 10px 0px;
  width: 110px;
  display: inline-block;
  background-color: rgb(74, 137, 220);
  color: #fff!important;
  margin-right: 5px;
  text-align: center;
  -moz-border-radius: 9px 9px 0px 0px;
  -webkit-border-radius: 9px 9px 0px 0px;
  border-radius: 9px 9px 0px 0px;
  font-color: #fff!important;
}

.nav-report-category li.active {
  background-color: #CB6015!important;
  color: #fff!important;
}

.nav-report-category li a:visited {
  color: #fff!important;
}

.nav-report-category li a {
  color: #fff!important;
}

.nav-report-category li:Hover {
  background-color: #BE3A34;
  text-decoration: none;
}

.tab-desc {
  background-color: rgb(93, 156, 236);
  color: #fff !important;
  padding: 5px;
}

.tab-desc H2 {
  color: #fff !important;
}</code>```

      Type

      Business Function

      Report Category

      Name
      Title

         Finance (9)

      rdl
      Accounting
      Finance
      AR Invoice Billing and Receipt History.rdl

      rdl
      Accounting
      Finance
      Financial Project Report V1.rdl

      rdl
      Accounting
      Finance
      Financial Project Report.rdl

      rdl
      Accounting
      Finance
      PA Billing Event Exception Details.rdl

      rdl
      Accounting
      Finance
      PA Expenditure Report.rdl

      rdl
      Accounting
      Finance
      Sales Order Detail Report.rdl

      rdl
      Accounting
      Finance
      Sales Order Summary Report.rdl

      rdl
      Accounting
      Finance
      WIP Reconciliation Report.rdl

      rdl
      Accounting
      Finance
      WIP Summary Report.rdl

         Markview (2)

      rdl
      Accounting
      Markview
      Markview Hold Report.rdl

      rdl
      Accounting
      Markview
      Markview Queue Rpt.rdl

```

答:
your ms-gb is on tr not on the td looking at your fiddle you provided. change it and it will start working

$(document).ready(function() {
  $(".ms-listviewtable tr[class='ms-gb']").each(function() {

    var mydiv = document.getElementsByClassName("nav-report-category")[0];
    var liTag = document.createElement('li');
    var aTag = document.createElement('a');

    var str = $(this).find("span:last").text();
    console.log(str)
    //var str = $(this).text();
    str = str.substring(str.indexOf(":") + 1); //remove everything before :
    str = str.substring(0, str.indexOf("(")); //remove counts

    if (!str.trim() || str.trim() == null) {
      liTag = document.createElement('li');
      aTag = document.createElement('a');
      aTag.innerHTML = "Other";
      var link = window.location.href + "&RC=" + str.trim();
    } else {
      liTag = document.createElement('li');
      aTag = document.createElement('a');
      aTag.innerHTML = str.trim();
      var link = window.location.href + "&RC=" + str.trim();
    }

    aTag.setAttribute('target', '_blank');
    aTag.setAttribute("href", link);
    console.log(liTag, mydiv);
    liTag.appendChild(aTag);

    mydiv.appendChild(liTag);
  });
});```
<pre class="snippet-code-css lang-css prettyprint-override"><code>.nav-report-category {
  border: none !important;
}

.nav-report-category li {
  font-size: 16px;
  padding: 10px 0px;
  width: 110px;
  display: inline-block;
  background-color: rgb(74, 137, 220);
  color: #fff!important;
  margin-right: 5px;
  text-align: center;
  -moz-border-radius: 9px 9px 0px 0px;
  -webkit-border-radius: 9px 9px 0px 0px;
  border-radius: 9px 9px 0px 0px;
  font-color: #fff!important;
}

.nav-report-category li.active {
  background-color: #CB6015!important;
  color: #fff!important;
}

.nav-report-category li a:visited {
  color: #fff!important;
}

.nav-report-category li a {
  color: #fff!important;
}

.nav-report-category li:Hover {
  background-color: #BE3A34;
  text-decoration: none;
}

.tab-desc {
  background-color: rgb(93, 156, 236);
  color: #fff !important;
  padding: 5px;
}

.tab-desc H2 {
  color: #fff !important;
}</code>```

      Type

      Business Function

      Report Category

      Name
      Title

         Finance (9)

      rdl
      Accounting
      Finance
      AR Invoice Billing and Receipt History.rdl

      rdl
      Accounting
      Finance
      Financial Project Report V1.rdl

      rdl
      Accounting
      Finance
      Financial Project Report.rdl

      rdl
      Accounting
      Finance
      PA Billing Event Exception Details.rdl

      rdl
      Accounting
      Finance
      PA Expenditure Report.rdl

      rdl
      Accounting
      Finance
      Sales Order Detail Report.rdl

      rdl
      Accounting
      Finance
      Sales Order Summary Report.rdl

      rdl
      Accounting
      Finance
      WIP Reconciliation Report.rdl

      rdl
      Accounting
      Finance
      WIP Summary Report.rdl

         Markview (2)

      rdl
      Accounting
      Markview
      Markview Hold Report.rdl

      rdl
      Accounting
      Markview
      Markview Queue Rpt.rdl

```

Title: How to read a class then a child class?

Body:
I am trying to find all the value in a child class using javascript (jquery). I am unable to pinpoint the issue using developer tool. I uploaded the HTML, javascript, and CSS FIDDLE

Just wanted to see what am I missing from my code that it doesn't even trigger the sample alert I have right after the loop of the parent-child code. HTML is here and in the fiddle. the alert should show Cost (1)

 Cost (1)

$(document).ready(function(){
    $(".ms-listviewtable td[class^='ms-gb']").each(function(){
      var mydiv = document.getElementsByClassName("nav-report-category")[0];
      var liTag = document.createElement('li');
      var aTag = document.createElement('a');
      var str = $(this).find("span:last");
      alert(str);

$(document).ready(function() {
  $(".ms-listviewtable .tr[class='ms-gb']").each(function() {
    alert('test');
    var mydiv = document.getElementsByClassName("nav-report-category")[0];
    var liTag = document.createElement('li');
    var aTag = document.createElement('a');

    var str = $(this).find("span:last");
    alert(str);
    //var str = $(this).text();
    str = str.substring(str.indexOf(":") + 1); //remove everything before :
    str = str.substring(0, str.indexOf("(")); //remove counts

    if (!str.trim() || str.trim() == null) {
      liTag = document.createElement('li');
      aTag = document.createElement('a');
      aTag.innerHTML = "Other";
      var link = window.location.href + "&RC=" + str.trim();
    } else {
      liTag = document.createElement('li');
      aTag = document.createElement('a');
      aTag.innerHTML = str.trim();
      var link = window.location.href + "&RC=" + str.trim();
    }

    aTag.setAttribute('target', '_blank');
    aTag.setAttribute("href", link);

    liTag.appendChild(aTag);
    mydiv.appendChild(liTag);
  });
});

.nav-report-category {
  border: none !important;
}

.nav-report-category li {
  font-size: 16px;
  padding: 10px 0px;
  width: 110px;
  display: inline-block;
  background-color: rgb(74, 137, 220);
  color: #fff!important;
  margin-right: 5px;
  text-align: center;
  -moz-border-radius: 9px 9px 0px 0px;
  -webkit-border-radius: 9px 9px 0px 0px;
  border-radius: 9px 9px 0px 0px;
  font-color: #fff!important;
}

.nav-report-category li.active {
  background-color: #CB6015!important;
  color: #fff!important;
}

.nav-report-category li a:visited {
  color: #fff!important;
}

.nav-report-category li a {
  color: #fff!important;
}

.nav-report-category li:Hover {
  background-color: #BE3A34;
  text-decoration: none;
}

.tab-desc {
  background-color: rgb(93, 156, 236);
  color: #fff !important;
  padding: 5px;
}

.tab-desc H2 {
  color: #fff !important;
}

      Type

      Business Function

      Report Category

      Name
      Title

         Finance (9)

        <a title="Click to open "AR Invoice Billing and Receipt History.rdl"" onclick="DispDocItemExWithServerRedirect(this, event, "FALSE", "FALSE", "FALSE", "", "1", "1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/AR%20Invoice%20Billing%20and%20Receipt%20History.rdl"); return false;"
          onmousedown="return VerifyHref(this, event, "1", "", "1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/AR%20Invoice%20Billing%20and%20Receipt%20History.rdl");"
          href="https://myanalytix.beta.com/SSRSReports/AR%20Invoice%20Billing%20and%20Receipt%20History.rdl">

      rdl
      Accounting
      Finance
      <a onclick="DispDocItemExWithServerRedirect(this, event, "FALSE", "FALSE", "FALSE", "", "1", "1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/AR%20Invoice%20Billing%20and%20Receipt%20History.rdl"); return false;"
          onmousedown="return VerifyHref(this, event, "1", "", "1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/AR%20Invoice%20Billing%20and%20Receipt%20History.rdl");"
          href="https://myanalytix.beta.com/SSRSReports/AR%20Invoice%20Billing%20and%20Receipt%20History.rdl">AR Invoice Billing and Receipt History.rdl

        <a title="Click to open "Financial Project Report V1.rdl"" onclick="DispDocItemExWithServerRedirect(this, event, "FALSE", "FALSE", "FALSE", "", "1", "1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/Financial%20Project%20Report%20V1.rdl"); return false;"
          onmousedown="return VerifyHref(this, event, "1", "", "1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/Financial%20Project%20Report%20V1.rdl");" href="https://myanalytix.beta.com/SSRSReports/Financial%20Project%20Report%20V1.rdl">

      rdl
      Accounting
      Finance
      <a onclick="DispDocItemExWithServerRedirect(this, event, "FALSE", "FALSE", "FALSE", "", "1", "1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/Financial%20Project%20Report%20V1.rdl"); return false;"
          onmousedown="return VerifyHref(this, event, "1", "", "1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/Financial%20Project%20Report%20V1.rdl");" href="https://myanalytix.beta.com/SSRSReports/Financial%20Project%20Report%20V1.rdl">Financial Project Report V1.rdl

        <a title="Click to open "Financial Project Report.rdl"" onclick="DispDocItemExWithServerRedirect(this, event, "FALSE", "FALSE", "FALSE", "", "1", "1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/Financial%20Project%20Report.rdl"); return false;"
          onmousedown="return VerifyHref(this, event, "1", "", "1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/Financial%20Project%20Report.rdl");" href="https://myanalytix.beta.com/SSRSReports/Financial%20Project%20Report.rdl">

      rdl
      Accounting
      Finance
      <a onclick="DispDocItemExWithServerRedirect(this, event, "FALSE", "FALSE", "FALSE", "", "1", "1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/Financial%20Project%20Report.rdl"); return false;"
          onmousedown="return VerifyHref(this, event, "1", "", "1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/Financial%20Project%20Report.rdl");" href="https://myanalytix.beta.com/SSRSReports/Financial%20Project%20Report.rdl">Financial Project Report.rdl

        <a title="Click to open "PA Billing Event Exception Details.rdl"" onclick="DispDocItemExWithServerRedirect(this, event, "FALSE", "FALSE", "FALSE", "", "1", "1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/PA%20Billing%20Event%20Exception%20Details.rdl"); return false;"
          onmousedown="return VerifyHref(this, event, "1", "", "1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/PA%20Billing%20Event%20Exception%20Details.rdl");" href="https://myanalytix.beta.com/SSRSReports/PA%20Billing%20Event%20Exception%20Details.rdl">

      rdl
      Accounting
      Finance
      <a onclick="DispDocItemExWithServerRedirect(this, event, "FALSE", "FALSE", "FALSE", "", "1", "1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/PA%20Billing%20Event%20Exception%20Details.rdl"); return false;"
          onmousedown="return VerifyHref(this, event, "1", "", "1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/PA%20Billing%20Event%20Exception%20Details.rdl");" href="https://myanalytix.beta.com/SSRSReports/PA%20Billing%20Event%20Exception%20Details.rdl">PA Billing Event Exception Details.rdl

        <a title="Click to open "PA Expenditure Report.rdl"" onclick="DispDocItemExWithServerRedirect(this, event, "FALSE", "FALSE", "FALSE", "", "1", "1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/PA%20Expenditure%20Report.rdl"); return false;"
          onmousedown="return VerifyHref(this, event, "1", "", "1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/PA%20Expenditure%20Report.rdl");" href="https://myanalytix.beta.com/SSRSReports/PA%20Expenditure%20Report.rdl">

      rdl
      Accounting
      Finance
      <a onclick="DispDocItemExWithServerRedirect(this, event, "FALSE", "FALSE", "FALSE", "", "1", "1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/PA%20Expenditure%20Report.rdl"); return false;"
          onmousedown="return VerifyHref(this, event, "1", "", "1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/PA%20Expenditure%20Report.rdl");" href="https://myanalytix.beta.com/SSRSReports/PA%20Expenditure%20Report.rdl">PA Expenditure Report.rdl

        <a title="Click to open "Sales Order Detail Report.rdl"" onclick="DispDocItemExWithServerRedirect(this, event, "FALSE", "FALSE", "FALSE", "", "1", "1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/Sales%20Order%20Detail%20Report.rdl"); return false;"
          onmousedown="return VerifyHref(this, event, "1", "", "1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/Sales%20Order%20Detail%20Report.rdl");" href="https://myanalytix.beta.com/SSRSReports/Sales%20Order%20Detail%20Report.rdl">

      rdl
      Accounting
      Finance
      <a onclick="DispDocItemExWithServerRedirect(this, event, "FALSE", "FALSE", "FALSE", "", "1", "1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/Sales%20Order%20Detail%20Report.rdl"); return false;"
          onmousedown="return VerifyHref(this, event, "1", "", "1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/Sales%20Order%20Detail%20Report.rdl");" href="https://myanalytix.beta.com/SSRSReports/Sales%20Order%20Detail%20Report.rdl">Sales Order Detail Report.rdl

        <a title="Click to open "Sales Order Summary Report.rdl"" onclick="DispDocItemExWithServerRedirect(this, event, "FALSE", "FALSE", "FALSE", "", "1", "1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/Sales%20Order%20Summary%20Report.rdl"); return false;"
          onmousedown="return VerifyHref(this, event, "1", "", "1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/Sales%20Order%20Summary%20Report.rdl");" href="https://myanalytix.beta.com/SSRSReports/Sales%20Order%20Summary%20Report.rdl">

      rdl
      Accounting
      Finance
      <a onclick="DispDocItemExWithServerRedirect(this, event, "FALSE", "FALSE", "FALSE", "", "1", "1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/Sales%20Order%20Summary%20Report.rdl"); return false;"
          onmousedown="return VerifyHref(this, event, "1", "", "1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/Sales%20Order%20Summary%20Report.rdl");" href="https://myanalytix.beta.com/SSRSReports/Sales%20Order%20Summary%20Report.rdl">Sales Order Summary Report.rdl

        <a title="Click to open "WIP Reconciliation Report.rdl"" onclick="DispDocItemExWithServerRedirect(this, event, "FALSE", "FALSE", "FALSE", "", "1", "1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/WIP%20Reconciliation%20Report.rdl"); return false;"
          onmousedown="return VerifyHref(this, event, "1", "", "1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/WIP%20Reconciliation%20Report.rdl");" href="https://myanalytix.beta.com/SSRSReports/WIP%20Reconciliation%20Report.rdl">

      rdl
      Accounting
      Finance
      <a onclick="DispDocItemExWithServerRedirect(this, event, "FALSE", "FALSE", "FALSE", "", "1", "1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/WIP%20Reconciliation%20Report.rdl"); return false;"
          onmousedown="return VerifyHref(this, event, "1", "", "1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/WIP%20Reconciliation%20Report.rdl");" href="https://myanalytix.beta.com/SSRSReports/WIP%20Reconciliation%20Report.rdl">WIP Reconciliation Report.rdl

        <a title="Click to open "WIP Summary Report.rdl"" onclick="DispDocItemExWithServerRedirect(this, event, "FALSE", "FALSE", "FALSE", "", "1", "1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/WIP%20Summary%20Report.rdl"); return false;"
          onmousedown="return VerifyHref(this, event, "1", "", "1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/WIP%20Summary%20Report.rdl");" href="https://myanalytix.beta.com/SSRSReports/WIP%20Summary%20Report.rdl">

      rdl
      Accounting
      Finance
      <a onclick="DispDocItemExWithServerRedirect(this, event, "FALSE", "FALSE", "FALSE", "", "1", "1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/WIP%20Summary%20Report.rdl"); return false;"
          onmousedown="return VerifyHref(this, event, "1", "", "1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/WIP%20Summary%20Report.rdl");" href="https://myanalytix.beta.com/SSRSReports/WIP%20Summary%20Report.rdl">WIP Summary Report.rdl

         Markview (2)

        <a title="Click to open "Markview Hold Report.rdl"" onclick="DispDocItemExWithServerRedirect(this, event, "FALSE", "FALSE", "FALSE", "", "1", "1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/Markview%20Hold%20Report.rdl"); return false;"
          onmousedown="return VerifyHref(this, event, "1", "", "1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/Markview%20Hold%20Report.rdl");" href="https://myanalytix.beta.com/SSRSReports/Markview%20Hold%20Report.rdl">

      rdl
      Accounting
      Markview
      <a onclick="DispDocItemExWithServerRedirect(this, event, "FALSE", "FALSE", "FALSE", "", "1", "1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/Markview%20Hold%20Report.rdl"); return false;"
          onmousedown="return VerifyHref(this, event, "1", "", "1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/Markview%20Hold%20Report.rdl");" href="https://myanalytix.beta.com/SSRSReports/Markview%20Hold%20Report.rdl">Markview Hold Report.rdl

        <a title="Click to open "Markview Queue Rpt.rdl"" onclick="DispDocItemExWithServerRedirect(this, event, "FALSE", "FALSE", "FALSE", "", "1", "1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/Markview%20Queue%20Rpt.rdl"); return false;"
          onmousedown="return VerifyHref(this, event, "1", "", "1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/Markview%20Queue%20Rpt.rdl");" href="https://myanalytix.beta.com/SSRSReports/Markview%20Queue%20Rpt.rdl">

      rdl
      Accounting
      Markview
      <a onclick="DispDocItemExWithServerRedirect(this, event, "FALSE", "FALSE", "FALSE", "", "1", "1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/Markview%20Queue%20Rpt.rdl"); return false;"
          onmousedown="return VerifyHref(this, event, "1", "", "1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/Markview%20Queue%20Rpt.rdl");" href="https://myanalytix.beta.com/SSRSReports/Markview%20Queue%20Rpt.rdl">Markview Queue Rpt.rdl

Body:
your ms-gb is on tr not on the td looking at your fiddle you provided. change it and it will start working

$(document).ready(function() {
  $(".ms-listviewtable tr[class='ms-gb']").each(function() {

    var mydiv = document.getElementsByClassName("nav-report-category")[0];
    var liTag = document.createElement('li');
    var aTag = document.createElement('a');

    var str = $(this).find("span:last").text();
    console.log(str)
    //var str = $(this).text();
    str = str.substring(str.indexOf(":") + 1); //remove everything before :
    str = str.substring(0, str.indexOf("(")); //remove counts

    if (!str.trim() || str.trim() == null) {
      liTag = document.createElement('li');
      aTag = document.createElement('a');
      aTag.innerHTML = "Other";
      var link = window.location.href + "&RC=" + str.trim();
    } else {
      liTag = document.createElement('li');
      aTag = document.createElement('a');
      aTag.innerHTML = str.trim();
      var link = window.location.href + "&RC=" + str.trim();
    }

    aTag.setAttribute('target', '_blank');
    aTag.setAttribute("href", link);
    console.log(liTag, mydiv);
    liTag.appendChild(aTag);

    mydiv.appendChild(liTag);
  });
});

.nav-report-category {
  border: none !important;
}

.nav-report-category li {
  font-size: 16px;
  padding: 10px 0px;
  width: 110px;
  display: inline-block;
  background-color: rgb(74, 137, 220);
  color: #fff!important;
  margin-right: 5px;
  text-align: center;
  -moz-border-radius: 9px 9px 0px 0px;
  -webkit-border-radius: 9px 9px 0px 0px;
  border-radius: 9px 9px 0px 0px;
  font-color: #fff!important;
}

.nav-report-category li.active {
  background-color: #CB6015!important;
  color: #fff!important;
}

.nav-report-category li a:visited {
  color: #fff!important;
}

.nav-report-category li a {
  color: #fff!important;
}

.nav-report-category li:Hover {
  background-color: #BE3A34;
  text-decoration: none;
}

.tab-desc {
  background-color: rgb(93, 156, 236);
  color: #fff !important;
  padding: 5px;
}

.tab-desc H2 {
  color: #fff !important;
}

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<table class="ms-listviewtable" cellspacing="0" id="ctl00_ctl40_g_653c0b92_a010_4d61_bad1_f8584423dda8__LT_GridViewContainerToDisplay" style="border-style:None;width:100%;border-collapse:collapse;">
  <tbody>
    <tr class="ms-viewheadertr">
      <th class="ms-vh2" scope="col" style="text-align:Center;">&nbsp;</th>
      <th class="ms-vh2" scope="col" style="text-align:Center;">&nbsp;</th>
      <th class="ms-vh2" scope="col" style="text-align:Center;"><a onclick="LTGridViewSortColumn_webPartUniqueId_g_653c0b92_a010_4d61_bad1_f8584423dda8(&quot;DocIcon&quot;);return false;" href="javascript:__doPostBack('ctl00$ctl40$g_653c0b92_a010_4d61_bad1_f8584423dda8$_LT_GridViewContainerToDisplay','Sort$DocIcon')">Type</a><span>&nbsp;</span>
        <img src="../_layouts/15/images/FILTER.GIF" title="Configure dynamic filtering for &quot;Type&quot; column" onclick="ConfigureDynamicFiltering_webPartUniqueId_g_653c0b92_a010_4d61_bad1_f8584423dda8(&quot;DocIcon&quot;);" style="cursor:pointer;"></th>
      <th class="ms-vh2" scope="col" style="text-align:Center;"><a onclick="LTGridViewSortColumn_webPartUniqueId_g_653c0b92_a010_4d61_bad1_f8584423dda8(&quot;BusinessFunction&quot;);return false;" href="javascript:__doPostBack('ctl00$ctl40$g_653c0b92_a010_4d61_bad1_f8584423dda8$_LT_GridViewContainerToDisplay','Sort$BusinessFunction')">Business Function</a><span>&nbsp;</span>
        <img src="../_layouts/15/images/FILTER.GIF" title="Configure dynamic filtering for &quot;Business Function&quot; column" onclick="ConfigureDynamicFiltering_webPartUniqueId_g_653c0b92_a010_4d61_bad1_f8584423dda8(&quot;BusinessFunction&quot;);" style="cursor:pointer;"></th>
      <th class="ms-vh2" scope="col" style="text-align:Center;"><a onclick="LTGridViewSortColumn_webPartUniqueId_g_653c0b92_a010_4d61_bad1_f8584423dda8(&quot;ReportCategory&quot;);return false;" href="javascript:__doPostBack('ctl00$ctl40$g_653c0b92_a010_4d61_bad1_f8584423dda8$_LT_GridViewContainerToDisplay','Sort$ReportCategory')">Report Category</a><span>&nbsp;</span>
        <img src="../_layouts/15/images/FILTER.GIF" title="Configure dynamic filtering for &quot;Report Category&quot; column" onclick="ConfigureDynamicFiltering_webPartUniqueId_g_653c0b92_a010_4d61_bad1_f8584423dda8(&quot;ReportCategory&quot;);" style="cursor:pointer;"></th>
      <th class="ms-vh2" scope="col" style="text-align:Center;"><a onclick="LTGridViewSortColumn_webPartUniqueId_g_653c0b92_a010_4d61_bad1_f8584423dda8(&quot;FileLeafRef&quot;);return false;" href="javascript:__doPostBack('ctl00$ctl40$g_653c0b92_a010_4d61_bad1_f8584423dda8$_LT_GridViewContainerToDisplay','Sort$FileLeafRef')">Name</a></th>
      <th class="ms-vh2" scope="col" style="text-align:Center;"><a onclick="LTGridViewSortColumn_webPartUniqueId_g_653c0b92_a010_4d61_bad1_f8584423dda8(&quot;Title&quot;);return false;" href="javascript:__doPostBack('ctl00$ctl40$g_653c0b92_a010_4d61_bad1_f8584423dda8$_LT_GridViewContainerToDisplay','Sort$Title')">Title</a><span>&nbsp;</span>
        <img src="../_layouts/15/images/FILTER.GIF" title="Configure dynamic filtering for &quot;Title&quot; column" onclick="ConfigureDynamicFiltering_webPartUniqueId_g_653c0b92_a010_4d61_bad1_f8584423dda8(&quot;Title&quot;);" style="cursor:pointer;"></th>
    </tr>
    <tr class="ms-gb" lgrp="1">
      <td colspan="7" style="padding-left:0px;">
        <a href="javascript:"><img id="lt_expandCollapseImage" src="/_layouts/15/images/plus.gif" onclick="_lt_LTGridViewExpandCollapseA(this.parentNode);" border="0" alt="Finance"></a>&nbsp;<span style="cursor:pointer;" onclick="_lt_LTGridViewExpandCollapseA(this);">Finance (9)</span></td>
    </tr>
    <tr style="display:none;">
      <td class="ms-vb2" style="width:5px;"><img src="/_layouts/15/images/blank.gif" width="5" height="1" alt=""></td>
      <td class="ms-vb2" align="center" style="width:1px;">
        <a title="Click to open &quot;AR Invoice Billing and Receipt History.rdl&quot;" onclick="DispDocItemExWithServerRedirect(this, event, &quot;FALSE&quot;, &quot;FALSE&quot;, &quot;FALSE&quot;, &quot;&quot;, &quot;1&quot;, &quot;1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/AR%20Invoice%20Billing%20and%20Receipt%20History.rdl&quot;); return false;"
          onmousedown="return VerifyHref(this, event, &quot;1&quot;, &quot;&quot;, &quot;1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/AR%20Invoice%20Billing%20and%20Receipt%20History.rdl&quot;);"
          href="https://myanalytix.beta.com/SSRSReports/AR%20Invoice%20Billing%20and%20Receipt%20History.rdl"><img title="Click to open &quot;AR Invoice Billing and Receipt History.rdl&quot;" src="../_layouts/15/images/doc_sp16.gif" alt=""></a>
      </td>
      <td class="ms-vb2">rdl</td>
      <td class="ms-vb2">Accounting</td>
      <td class="ms-vb2">Finance</td>
      <td class="ms-vb2"><a onclick="DispDocItemExWithServerRedirect(this, event, &quot;FALSE&quot;, &quot;FALSE&quot;, &quot;FALSE&quot;, &quot;&quot;, &quot;1&quot;, &quot;1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/AR%20Invoice%20Billing%20and%20Receipt%20History.rdl&quot;); return false;"
          onmousedown="return VerifyHref(this, event, &quot;1&quot;, &quot;&quot;, &quot;1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/AR%20Invoice%20Billing%20and%20Receipt%20History.rdl&quot;);"
          href="https://myanalytix.beta.com/SSRSReports/AR%20Invoice%20Billing%20and%20Receipt%20History.rdl">AR Invoice Billing and Receipt History.rdl</a></td>
      <td class="ms-vb2">&nbsp;</td>
    </tr>
    <tr class="ms-alternating" style="display:none;">
      <td class="ms-vb2" style="width:5px;"><img src="/_layouts/15/images/blank.gif" width="5" height="1" alt=""></td>
      <td class="ms-vb2" align="center" style="width:1px;">
        <a title="Click to open &quot;Financial Project Report V1.rdl&quot;" onclick="DispDocItemExWithServerRedirect(this, event, &quot;FALSE&quot;, &quot;FALSE&quot;, &quot;FALSE&quot;, &quot;&quot;, &quot;1&quot;, &quot;1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/Financial%20Project%20Report%20V1.rdl&quot;); return false;"
          onmousedown="return VerifyHref(this, event, &quot;1&quot;, &quot;&quot;, &quot;1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/Financial%20Project%20Report%20V1.rdl&quot;);" href="https://myanalytix.beta.com/SSRSReports/Financial%20Project%20Report%20V1.rdl"><img title="Click to open &quot;Financial Project Report V1.rdl&quot;" src="../_layouts/15/images/doc_sp16.gif" alt=""></a>
      </td>
      <td class="ms-vb2">rdl</td>
      <td class="ms-vb2">Accounting</td>
      <td class="ms-vb2">Finance</td>
      <td class="ms-vb2"><a onclick="DispDocItemExWithServerRedirect(this, event, &quot;FALSE&quot;, &quot;FALSE&quot;, &quot;FALSE&quot;, &quot;&quot;, &quot;1&quot;, &quot;1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/Financial%20Project%20Report%20V1.rdl&quot;); return false;"
          onmousedown="return VerifyHref(this, event, &quot;1&quot;, &quot;&quot;, &quot;1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/Financial%20Project%20Report%20V1.rdl&quot;);" href="https://myanalytix.beta.com/SSRSReports/Financial%20Project%20Report%20V1.rdl">Financial Project Report V1.rdl</a></td>
      <td class="ms-vb2">&nbsp;</td>
    </tr>
    <tr style="display:none;">
      <td class="ms-vb2" style="width:5px;"><img src="/_layouts/15/images/blank.gif" width="5" height="1" alt=""></td>
      <td class="ms-vb2" align="center" style="width:1px;">
        <a title="Click to open &quot;Financial Project Report.rdl&quot;" onclick="DispDocItemExWithServerRedirect(this, event, &quot;FALSE&quot;, &quot;FALSE&quot;, &quot;FALSE&quot;, &quot;&quot;, &quot;1&quot;, &quot;1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/Financial%20Project%20Report.rdl&quot;); return false;"
          onmousedown="return VerifyHref(this, event, &quot;1&quot;, &quot;&quot;, &quot;1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/Financial%20Project%20Report.rdl&quot;);" href="https://myanalytix.beta.com/SSRSReports/Financial%20Project%20Report.rdl"><img title="Click to open &quot;Financial Project Report.rdl&quot;" src="../_layouts/15/images/doc_sp16.gif" alt=""></a>
      </td>
      <td class="ms-vb2">rdl</td>
      <td class="ms-vb2">Accounting</td>
      <td class="ms-vb2">Finance</td>
      <td class="ms-vb2"><a onclick="DispDocItemExWithServerRedirect(this, event, &quot;FALSE&quot;, &quot;FALSE&quot;, &quot;FALSE&quot;, &quot;&quot;, &quot;1&quot;, &quot;1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/Financial%20Project%20Report.rdl&quot;); return false;"
          onmousedown="return VerifyHref(this, event, &quot;1&quot;, &quot;&quot;, &quot;1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/Financial%20Project%20Report.rdl&quot;);" href="https://myanalytix.beta.com/SSRSReports/Financial%20Project%20Report.rdl">Financial Project Report.rdl</a></td>
      <td class="ms-vb2">&nbsp;</td>
    </tr>
    <tr class="ms-alternating" style="display:none;">
      <td class="ms-vb2" style="width:5px;"><img src="/_layouts/15/images/blank.gif" width="5" height="1" alt=""></td>
      <td class="ms-vb2" align="center" style="width:1px;">
        <a title="Click to open &quot;PA Billing Event Exception Details.rdl&quot;" onclick="DispDocItemExWithServerRedirect(this, event, &quot;FALSE&quot;, &quot;FALSE&quot;, &quot;FALSE&quot;, &quot;&quot;, &quot;1&quot;, &quot;1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/PA%20Billing%20Event%20Exception%20Details.rdl&quot;); return false;"
          onmousedown="return VerifyHref(this, event, &quot;1&quot;, &quot;&quot;, &quot;1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/PA%20Billing%20Event%20Exception%20Details.rdl&quot;);" href="https://myanalytix.beta.com/SSRSReports/PA%20Billing%20Event%20Exception%20Details.rdl"><img title="Click to open &quot;PA Billing Event Exception Details.rdl&quot;" src="../_layouts/15/images/doc_sp16.gif" alt=""></a>
      </td>
      <td class="ms-vb2">rdl</td>
      <td class="ms-vb2">Accounting</td>
      <td class="ms-vb2">Finance</td>
      <td class="ms-vb2"><a onclick="DispDocItemExWithServerRedirect(this, event, &quot;FALSE&quot;, &quot;FALSE&quot;, &quot;FALSE&quot;, &quot;&quot;, &quot;1&quot;, &quot;1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/PA%20Billing%20Event%20Exception%20Details.rdl&quot;); return false;"
          onmousedown="return VerifyHref(this, event, &quot;1&quot;, &quot;&quot;, &quot;1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/PA%20Billing%20Event%20Exception%20Details.rdl&quot;);" href="https://myanalytix.beta.com/SSRSReports/PA%20Billing%20Event%20Exception%20Details.rdl">PA Billing Event Exception Details.rdl</a></td>
      <td class="ms-vb2">&nbsp;</td>
    </tr>
    <tr style="display:none;">
      <td class="ms-vb2" style="width:5px;"><img src="/_layouts/15/images/blank.gif" width="5" height="1" alt=""></td>
      <td class="ms-vb2" align="center" style="width:1px;">
        <a title="Click to open &quot;PA Expenditure Report.rdl&quot;" onclick="DispDocItemExWithServerRedirect(this, event, &quot;FALSE&quot;, &quot;FALSE&quot;, &quot;FALSE&quot;, &quot;&quot;, &quot;1&quot;, &quot;1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/PA%20Expenditure%20Report.rdl&quot;); return false;"
          onmousedown="return VerifyHref(this, event, &quot;1&quot;, &quot;&quot;, &quot;1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/PA%20Expenditure%20Report.rdl&quot;);" href="https://myanalytix.beta.com/SSRSReports/PA%20Expenditure%20Report.rdl"><img title="Click to open &quot;PA Expenditure Report.rdl&quot;" src="../_layouts/15/images/doc_sp16.gif" alt=""></a>
      </td>
      <td class="ms-vb2">rdl</td>
      <td class="ms-vb2">Accounting</td>
      <td class="ms-vb2">Finance</td>
      <td class="ms-vb2"><a onclick="DispDocItemExWithServerRedirect(this, event, &quot;FALSE&quot;, &quot;FALSE&quot;, &quot;FALSE&quot;, &quot;&quot;, &quot;1&quot;, &quot;1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/PA%20Expenditure%20Report.rdl&quot;); return false;"
          onmousedown="return VerifyHref(this, event, &quot;1&quot;, &quot;&quot;, &quot;1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/PA%20Expenditure%20Report.rdl&quot;);" href="https://myanalytix.beta.com/SSRSReports/PA%20Expenditure%20Report.rdl">PA Expenditure Report.rdl</a></td>
      <td class="ms-vb2">&nbsp;</td>
    </tr>
    <tr class="ms-alternating" style="display:none;">
      <td class="ms-vb2" style="width:5px;"><img src="/_layouts/15/images/blank.gif" width="5" height="1" alt=""></td>
      <td class="ms-vb2" align="center" style="width:1px;">
        <a title="Click to open &quot;Sales Order Detail Report.rdl&quot;" onclick="DispDocItemExWithServerRedirect(this, event, &quot;FALSE&quot;, &quot;FALSE&quot;, &quot;FALSE&quot;, &quot;&quot;, &quot;1&quot;, &quot;1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/Sales%20Order%20Detail%20Report.rdl&quot;); return false;"
          onmousedown="return VerifyHref(this, event, &quot;1&quot;, &quot;&quot;, &quot;1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/Sales%20Order%20Detail%20Report.rdl&quot;);" href="https://myanalytix.beta.com/SSRSReports/Sales%20Order%20Detail%20Report.rdl"><img title="Click to open &quot;Sales Order Detail Report.rdl&quot;" src="../_layouts/15/images/doc_sp16.gif" alt=""></a>
      </td>
      <td class="ms-vb2">rdl</td>
      <td class="ms-vb2">Accounting</td>
      <td class="ms-vb2">Finance</td>
      <td class="ms-vb2"><a onclick="DispDocItemExWithServerRedirect(this, event, &quot;FALSE&quot;, &quot;FALSE&quot;, &quot;FALSE&quot;, &quot;&quot;, &quot;1&quot;, &quot;1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/Sales%20Order%20Detail%20Report.rdl&quot;); return false;"
          onmousedown="return VerifyHref(this, event, &quot;1&quot;, &quot;&quot;, &quot;1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/Sales%20Order%20Detail%20Report.rdl&quot;);" href="https://myanalytix.beta.com/SSRSReports/Sales%20Order%20Detail%20Report.rdl">Sales Order Detail Report.rdl</a></td>
      <td class="ms-vb2">&nbsp;</td>
    </tr>
    <tr style="display:none;">
      <td class="ms-vb2" style="width:5px;"><img src="/_layouts/15/images/blank.gif" width="5" height="1" alt=""></td>
      <td class="ms-vb2" align="center" style="width:1px;">
        <a title="Click to open &quot;Sales Order Summary Report.rdl&quot;" onclick="DispDocItemExWithServerRedirect(this, event, &quot;FALSE&quot;, &quot;FALSE&quot;, &quot;FALSE&quot;, &quot;&quot;, &quot;1&quot;, &quot;1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/Sales%20Order%20Summary%20Report.rdl&quot;); return false;"
          onmousedown="return VerifyHref(this, event, &quot;1&quot;, &quot;&quot;, &quot;1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/Sales%20Order%20Summary%20Report.rdl&quot;);" href="https://myanalytix.beta.com/SSRSReports/Sales%20Order%20Summary%20Report.rdl"><img title="Click to open &quot;Sales Order Summary Report.rdl&quot;" src="../_layouts/15/images/doc_sp16.gif" alt=""></a>
      </td>
      <td class="ms-vb2">rdl</td>
      <td class="ms-vb2">Accounting</td>
      <td class="ms-vb2">Finance</td>
      <td class="ms-vb2"><a onclick="DispDocItemExWithServerRedirect(this, event, &quot;FALSE&quot;, &quot;FALSE&quot;, &quot;FALSE&quot;, &quot;&quot;, &quot;1&quot;, &quot;1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/Sales%20Order%20Summary%20Report.rdl&quot;); return false;"
          onmousedown="return VerifyHref(this, event, &quot;1&quot;, &quot;&quot;, &quot;1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/Sales%20Order%20Summary%20Report.rdl&quot;);" href="https://myanalytix.beta.com/SSRSReports/Sales%20Order%20Summary%20Report.rdl">Sales Order Summary Report.rdl</a></td>
      <td class="ms-vb2">&nbsp;</td>
    </tr>
    <tr class="ms-alternating" style="display:none;">
      <td class="ms-vb2" style="width:5px;"><img src="/_layouts/15/images/blank.gif" width="5" height="1" alt=""></td>
      <td class="ms-vb2" align="center" style="width:1px;">
        <a title="Click to open &quot;WIP Reconciliation Report.rdl&quot;" onclick="DispDocItemExWithServerRedirect(this, event, &quot;FALSE&quot;, &quot;FALSE&quot;, &quot;FALSE&quot;, &quot;&quot;, &quot;1&quot;, &quot;1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/WIP%20Reconciliation%20Report.rdl&quot;); return false;"
          onmousedown="return VerifyHref(this, event, &quot;1&quot;, &quot;&quot;, &quot;1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/WIP%20Reconciliation%20Report.rdl&quot;);" href="https://myanalytix.beta.com/SSRSReports/WIP%20Reconciliation%20Report.rdl"><img title="Click to open &quot;WIP Reconciliation Report.rdl&quot;" src="../_layouts/15/images/doc_sp16.gif" alt=""></a>
      </td>
      <td class="ms-vb2">rdl</td>
      <td class="ms-vb2">Accounting</td>
      <td class="ms-vb2">Finance</td>
      <td class="ms-vb2"><a onclick="DispDocItemExWithServerRedirect(this, event, &quot;FALSE&quot;, &quot;FALSE&quot;, &quot;FALSE&quot;, &quot;&quot;, &quot;1&quot;, &quot;1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/WIP%20Reconciliation%20Report.rdl&quot;); return false;"
          onmousedown="return VerifyHref(this, event, &quot;1&quot;, &quot;&quot;, &quot;1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/WIP%20Reconciliation%20Report.rdl&quot;);" href="https://myanalytix.beta.com/SSRSReports/WIP%20Reconciliation%20Report.rdl">WIP Reconciliation Report.rdl</a></td>
      <td class="ms-vb2">&nbsp;</td>
    </tr>
    <tr style="display:none;">
      <td class="ms-vb2" style="width:5px;"><img src="/_layouts/15/images/blank.gif" width="5" height="1" alt=""></td>
      <td class="ms-vb2" align="center" style="width:1px;">
        <a title="Click to open &quot;WIP Summary Report.rdl&quot;" onclick="DispDocItemExWithServerRedirect(this, event, &quot;FALSE&quot;, &quot;FALSE&quot;, &quot;FALSE&quot;, &quot;&quot;, &quot;1&quot;, &quot;1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/WIP%20Summary%20Report.rdl&quot;); return false;"
          onmousedown="return VerifyHref(this, event, &quot;1&quot;, &quot;&quot;, &quot;1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/WIP%20Summary%20Report.rdl&quot;);" href="https://myanalytix.beta.com/SSRSReports/WIP%20Summary%20Report.rdl"><img title="Click to open &quot;WIP Summary Report.rdl&quot;" src="../_layouts/15/images/doc_sp16.gif" alt=""></a>
      </td>
      <td class="ms-vb2">rdl</td>
      <td class="ms-vb2">Accounting</td>
      <td class="ms-vb2">Finance</td>
      <td class="ms-vb2"><a onclick="DispDocItemExWithServerRedirect(this, event, &quot;FALSE&quot;, &quot;FALSE&quot;, &quot;FALSE&quot;, &quot;&quot;, &quot;1&quot;, &quot;1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/WIP%20Summary%20Report.rdl&quot;); return false;"
          onmousedown="return VerifyHref(this, event, &quot;1&quot;, &quot;&quot;, &quot;1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/WIP%20Summary%20Report.rdl&quot;);" href="https://myanalytix.beta.com/SSRSReports/WIP%20Summary%20Report.rdl">WIP Summary Report.rdl</a></td>
      <td class="ms-vb2">&nbsp;</td>
    </tr>
    <tr class="ms-gb" lgrp="1">
      <td colspan="7" style="padding-left:0px;">
        <a href="javascript:"><img id="lt_expandCollapseImage" src="/_layouts/15/images/plus.gif" onclick="_lt_LTGridViewExpandCollapseA(this.parentNode);" border="0" alt="Markview"></a>&nbsp;<span style="cursor:pointer;" onclick="_lt_LTGridViewExpandCollapseA(this);">Markview (2)</span></td>
    </tr>
    <tr class="ms-alternating" style="display:none;">
      <td class="ms-vb2" style="width:5px;"><img src="/_layouts/15/images/blank.gif" width="5" height="1" alt=""></td>
      <td class="ms-vb2" align="center" style="width:1px;">
        <a title="Click to open &quot;Markview Hold Report.rdl&quot;" onclick="DispDocItemExWithServerRedirect(this, event, &quot;FALSE&quot;, &quot;FALSE&quot;, &quot;FALSE&quot;, &quot;&quot;, &quot;1&quot;, &quot;1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/Markview%20Hold%20Report.rdl&quot;); return false;"
          onmousedown="return VerifyHref(this, event, &quot;1&quot;, &quot;&quot;, &quot;1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/Markview%20Hold%20Report.rdl&quot;);" href="https://myanalytix.beta.com/SSRSReports/Markview%20Hold%20Report.rdl"><img title="Click to open &quot;Markview Hold Report.rdl&quot;" src="../_layouts/15/images/doc_sp16.gif" alt=""></a>
      </td>
      <td class="ms-vb2">rdl</td>
      <td class="ms-vb2">Accounting</td>
      <td class="ms-vb2">Markview</td>
      <td class="ms-vb2"><a onclick="DispDocItemExWithServerRedirect(this, event, &quot;FALSE&quot;, &quot;FALSE&quot;, &quot;FALSE&quot;, &quot;&quot;, &quot;1&quot;, &quot;1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/Markview%20Hold%20Report.rdl&quot;); return false;"
          onmousedown="return VerifyHref(this, event, &quot;1&quot;, &quot;&quot;, &quot;1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/Markview%20Hold%20Report.rdl&quot;);" href="https://myanalytix.beta.com/SSRSReports/Markview%20Hold%20Report.rdl">Markview Hold Report.rdl</a></td>
      <td class="ms-vb2">&nbsp;</td>
    </tr>
    <tr style="display:none;">
      <td class="ms-vb2" style="width:5px;"><img src="/_layouts/15/images/blank.gif" width="5" height="1" alt=""></td>
      <td class="ms-vb2" align="center" style="width:1px;">
        <a title="Click to open &quot;Markview Queue Rpt.rdl&quot;" onclick="DispDocItemExWithServerRedirect(this, event, &quot;FALSE&quot;, &quot;FALSE&quot;, &quot;FALSE&quot;, &quot;&quot;, &quot;1&quot;, &quot;1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/Markview%20Queue%20Rpt.rdl&quot;); return false;"
          onmousedown="return VerifyHref(this, event, &quot;1&quot;, &quot;&quot;, &quot;1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/Markview%20Queue%20Rpt.rdl&quot;);" href="https://myanalytix.beta.com/SSRSReports/Markview%20Queue%20Rpt.rdl"><img title="Click to open &quot;Markview Queue Rpt.rdl&quot;" src="../_layouts/15/images/doc_sp16.gif" alt=""></a>
      </td>
      <td class="ms-vb2">rdl</td>
      <td class="ms-vb2">Accounting</td>
      <td class="ms-vb2">Markview</td>
      <td class="ms-vb2"><a onclick="DispDocItemExWithServerRedirect(this, event, &quot;FALSE&quot;, &quot;FALSE&quot;, &quot;FALSE&quot;, &quot;&quot;, &quot;1&quot;, &quot;1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/Markview%20Queue%20Rpt.rdl&quot;); return false;"
          onmousedown="return VerifyHref(this, event, &quot;1&quot;, &quot;&quot;, &quot;1https://myanalytix.beta.com/_layouts/15/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/SSRSReports/Markview%20Queue%20Rpt.rdl&quot;);" href="https://myanalytix.beta.com/SSRSReports/Markview%20Queue%20Rpt.rdl">Markview Queue Rpt.rdl</a></td>
      <td class="ms-vb2">&nbsp;</td>
    </tr>
  </tbody>
</table>


来源: stackexchange

问:
SQL Server compare results of two queries that should be identical
I am modifying a sql server 2005 stored procedure slightly for performance, and I would like to quickly make sure the old stored proc and the new one return the exact same results (the columns are the same, I want to make sure the rows are the same).

Is there a simple way to do this in sql server 2005?

答:
The stored proc below will compare the output resultset of 2 stored procedures, or 2 statements.  The key here is the SP does not need to know the structure or schema of the result set, thus you can arbitrarily test any SP.  It will return 0 rows if the output is the same.  This solution uses openrowset command in SQL Server.
Here is some sample usage of the Stored proc

```<code>DECLARE @SQL_SP1 VARCHAR(MAX)
DECLARE @SQL_SP2 VARCHAR(MAX)

-- Compare results of 2 Stored Procs
SET @SQL_SP1 = 'EXEC SomeDB.dbo.[usp_GetWithTheProgram_OLD] 100, ''SomeParamX'''
SET @SQL_SP1 = 'EXEC SomeDB.dbo.[usp_GetWithTheProgram_NEW] 50, ''SomeParamX'''
EXEC utlCompareStatementResults @SQL_SP1, @SQL_SP2

-- Compare just 2 SQL Statements
SET @SQL_SP1 = 'SELECT * FROM SomeDB.dbo.Table1 WHERE CreatedOn > ''2016-05-08'''
SET @SQL_SP1 = 'SELECT * FROM SomeDB.dbo.Table1 WHERE CreatedOn > ''2016-06-11'''
EXEC utlCompareStatementResults @SQL_SP1, @SQL_SP2
</code>```

The SP requires the following prerequisites, which may not be ideal for a production environment, but very useful for local QA, DEV and Test environments.  It uses openrowset in the code.

```<code>EXEC sp_configure 'show advanced options', 1
EXEC sp_configure 'ad hoc distributed queries', 1
EXEC sp_serveroption @@SERVERNAME, 'DATA ACCESS', TRUE
</code>```

Here is the code for the stored proc.

```<code>==================================================================================
    --== SUMMARY utlCompareStatementResults
    --==    - requires sp_configure 'show advanced options', 1
    --==    - requires sp_configure 'ad hoc distributed queries', 1
    --==    - maybe requires EXEC sp_serveroption @@SERVERNAME, 'DATA ACCESS', TRUE
    --==    - requires the RecordSet Output to have Unique ColumnNames (no duplicate columns)
    --==    - requires references in straight SQL to be fully qualified [dbname].[schema].[objects] but not within an SP
    --==    - requires references SP call to be fully qualifed [dbname].[schema].[spname] but not objects with the SP
    --== OUTPUT
    --==    Differences are returned
    --==    If there is no recordset returned, then theres no differences
    --==    However if you are comparing 2 empty recordsets, it doesn't mean anything
    --== USAGE
    --==   DECLARE @SQL_SP1 VARCHAR(MAX)
    --==   DECLARE @SQL_SP2 VARCHAR(MAX)
    --==   -- Compare just 2 SQL Statements
    --==   SET @SQL_SP1 = 'SELECT * FROM SomeDB.dbo.Table1 WHERE CreatedOn > ''2016-05-08'''
    --==   SET @SQL_SP1 = 'SELECT * FROM SomeDB.dbo.Table1 WHERE CreatedOn > ''2016-06-11'''
    --==   EXEC utlCompareStatementResults @SQL_SP1, @SQL_SP2
    --==
    --==   -- Compare results of 2 Stored Procs
    --==   SET @SQL_SP1 = 'EXEC SomeDB.dbo.[usp_GetWithTheProgram_OLD] 100, ''SomeParamX'''
    --==   SET @SQL_SP1 = 'EXEC SomeDB.dbo.[usp_GetWithTheProgram_NEW] 50, ''SomeParamX'''
    --==   EXEC utlCompareStatementResults @SQL_SP1, @SQL_SP2
    --==================================================================================
    CREATE PROCEDURE utlCompareStatementResults
       @SQL_SP1 VARCHAR(MAX),
       @SQL_SP2 VARCHAR(MAX)
    AS
    BEGIN
        DECLARE @TABLE1 VARCHAR(200)
        DECLARE @TABLE2 VARCHAR(200)
        DECLARE @SQL_OPENROWSET VARCHAR(MAX)
        DECLARE @CONNECTION VARCHAR(100)

        SET @CONNECTION = 'server='+@@SERVERNAME+';Trusted_Connection=yes'

        SET @SQL_SP1 = REPLACE(@SQL_SP1, '''','''''')
        SET @SQL_SP2 = REPLACE(@SQL_SP2, '''','''''')

        SET @TABLE1 = '#' + SUBSTRING(CONVERT(VARCHAR(250),NEWID()), 1, 8)
        SET @TABLE2 = '#' + SUBSTRING(CONVERT(VARCHAR(250),NEWID()), 1, 8)

        SET @SQL_OPENROWSET =
        'SELECT * ' + ' ' +
        'INTO ' + @TABLE1 + ' ' +
        'FROM OPENROWSET(''SQLNCLI'', ' + '''' + @CONNECTION + '''' +
                        ',''' + @SQL_SP1 +'''); ' +
        'SELECT * ' + ' ' +
        'INTO ' + @TABLE2 + ' ' +
        'FROM OPENROWSET(''SQLNCLI'', ' + '''' + @CONNECTION + '''' +
                        ',''' + @SQL_SP2 +'''); ' +
        '(SELECT * FROM ' + @TABLE1 + ' EXCEPT SELECT * FROM ' + @TABLE2 + ') '  +
        ' UNION ALL ' +
        '(SELECT * FROM ' + @TABLE2 + ' EXCEPT SELECT * FROM ' + @TABLE1 + '); ' +
        'DROP TABLE ' + @TABLE1 + '; ' +
        'DROP TABLE ' + @TABLE2 + '; '
        PRINT @SQL_OPENROWSET
        EXEC (@SQL_OPENROWSET)
        PRINT 'DifferenceCount: ' + CONVERT(VARCHAR(100), @@ROWCOUNT)
    END
</code>```

ContentLicense: CC BY-SA 3.0

Body:
The stored proc below will compare the output resultset of 2 stored procedures, or 2 statements.  The key here is the SP does not need to know the structure or schema of the result set, thus you can arbitrarily test any SP.  It will return 0 rows if the output is the same.  This solution uses openrowset command in SQL Server.
Here is some sample usage of the Stored proc

DECLARE @SQL_SP1 VARCHAR(MAX)
DECLARE @SQL_SP2 VARCHAR(MAX)

-- Compare results of 2 Stored Procs
SET @SQL_SP1 = 'EXEC SomeDB.dbo.[usp_GetWithTheProgram_OLD] 100, ''SomeParamX'''
SET @SQL_SP1 = 'EXEC SomeDB.dbo.[usp_GetWithTheProgram_NEW] 50, ''SomeParamX'''
EXEC utlCompareStatementResults @SQL_SP1, @SQL_SP2

-- Compare just 2 SQL Statements
SET @SQL_SP1 = 'SELECT * FROM SomeDB.dbo.Table1 WHERE CreatedOn > ''2016-05-08'''
SET @SQL_SP1 = 'SELECT * FROM SomeDB.dbo.Table1 WHERE CreatedOn > ''2016-06-11'''
EXEC utlCompareStatementResults @SQL_SP1, @SQL_SP2

The SP requires the following prerequisites, which may not be ideal for a production environment, but very useful for local QA, DEV and Test environments.  It uses openrowset in the code.

EXEC sp_configure 'show advanced options', 1
EXEC sp_configure 'ad hoc distributed queries', 1
EXEC sp_serveroption @@SERVERNAME, 'DATA ACCESS', TRUE

Here is the code for the stored proc.

==================================================================================
    --== SUMMARY utlCompareStatementResults
    --==    - requires sp_configure 'show advanced options', 1
    --==    - requires sp_configure 'ad hoc distributed queries', 1
    --==    - maybe requires EXEC sp_serveroption @@SERVERNAME, 'DATA ACCESS', TRUE
    --==    - requires the RecordSet Output to have Unique ColumnNames (no duplicate columns)
    --==    - requires references in straight SQL to be fully qualified [dbname].[schema].[objects] but not within an SP
    --==    - requires references SP call to be fully qualifed [dbname].[schema].[spname] but not objects with the SP
    --== OUTPUT
    --==    Differences are returned
    --==    If there is no recordset returned, then theres no differences
    --==    However if you are comparing 2 empty recordsets, it doesn't mean anything
    --== USAGE
    --==   DECLARE @SQL_SP1 VARCHAR(MAX)
    --==   DECLARE @SQL_SP2 VARCHAR(MAX)
    --==   -- Compare just 2 SQL Statements
    --==   SET @SQL_SP1 = 'SELECT * FROM SomeDB.dbo.Table1 WHERE CreatedOn > ''2016-05-08'''
    --==   SET @SQL_SP1 = 'SELECT * FROM SomeDB.dbo.Table1 WHERE CreatedOn > ''2016-06-11'''
    --==   EXEC utlCompareStatementResults @SQL_SP1, @SQL_SP2
    --==
    --==   -- Compare results of 2 Stored Procs
    --==   SET @SQL_SP1 = 'EXEC SomeDB.dbo.[usp_GetWithTheProgram_OLD] 100, ''SomeParamX'''
    --==   SET @SQL_SP1 = 'EXEC SomeDB.dbo.[usp_GetWithTheProgram_NEW] 50, ''SomeParamX'''
    --==   EXEC utlCompareStatementResults @SQL_SP1, @SQL_SP2
    --==================================================================================
    CREATE PROCEDURE utlCompareStatementResults
       @SQL_SP1 VARCHAR(MAX),
       @SQL_SP2 VARCHAR(MAX)
    AS
    BEGIN
        DECLARE @TABLE1 VARCHAR(200)
        DECLARE @TABLE2 VARCHAR(200)
        DECLARE @SQL_OPENROWSET VARCHAR(MAX)
        DECLARE @CONNECTION VARCHAR(100)

        SET @CONNECTION = 'server='+@@SERVERNAME+';Trusted_Connection=yes'

        SET @SQL_SP1 = REPLACE(@SQL_SP1, '''','''''')
        SET @SQL_SP2 = REPLACE(@SQL_SP2, '''','''''')

        SET @TABLE1 = '#' + SUBSTRING(CONVERT(VARCHAR(250),NEWID()), 1, 8)
        SET @TABLE2 = '#' + SUBSTRING(CONVERT(VARCHAR(250),NEWID()), 1, 8)

        SET @SQL_OPENROWSET =
        'SELECT * ' + ' ' +
        'INTO ' + @TABLE1 + ' ' +
        'FROM OPENROWSET(''SQLNCLI'', ' + '''' + @CONNECTION + '''' +
                        ',''' + @SQL_SP1 +'''); ' +
        'SELECT * ' + ' ' +
        'INTO ' + @TABLE2 + ' ' +
        'FROM OPENROWSET(''SQLNCLI'', ' + '''' + @CONNECTION + '''' +
                        ',''' + @SQL_SP2 +'''); ' +
        '(SELECT * FROM ' + @TABLE1 + ' EXCEPT SELECT * FROM ' + @TABLE2 + ') '  +
        ' UNION ALL ' +
        '(SELECT * FROM ' + @TABLE2 + ' EXCEPT SELECT * FROM ' + @TABLE1 + '); ' +
        'DROP TABLE ' + @TABLE1 + '; ' +
        'DROP TABLE ' + @TABLE2 + '; '
        PRINT @SQL_OPENROWSET
        EXEC (@SQL_OPENROWSET)
        PRINT 'DifferenceCount: ' + CONVERT(VARCHAR(100), @@ROWCOUNT)
    END


问:
how to make the html table header fixed + Content above the table to be fixed
please help, I have a html table , without changing the layout and responsive behavior - i want to make table header fixed - please suggest

https://codepen.io/shaswat/pen/EbwPNK

here want to implement table header and responsiveness of the table both together . which is not working

while scrolling down -- 3 headers and the table head should get fixed .

.rg-container {
  font-family: 'Lato', Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  margin: 0;
  padding: 1em 0.5em;
  color: #222;
}

.rg-header {
  margin-bottom: 1em;
  text-align: left;
}

.rg-header>* {
  display: block;
}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><h1>Some more Header information</h1>
<h2>Some more Header information</h2>
<h3>Header
  <div>
    <div class='rg-container'>
      <div class='rg-content'>
        <table class='rg-table'>
          <thead>
            <tr>
              <th class='text '>id</th>
              <th class='text '>somcol</th>
              <th class='text '>biggger id</th>
              <th class='text '>another id</th>
              <th class='text '>med col</th>
              <th class='text '>med col</th>
            </tr>
          </thead>
          <tbody>

            <tr class=''>
              <td class='text ' data-title='id'>id</td>
              <td class='text ' data-title='somcol'>somcol</td>
              <td class='text ' data-title='biggger id'>biggger id</td>
              <td class='text ' data-title='another id'>another id</td>
              <td class='text ' data-title='med col'>med col</td>
              <td class='text ' data-title='med col'>med col</td>
              <td class='text ' data-title='sheet'>sheet</td>
              <td class='text ' data-title='sheet'>sheet</td>
              <td class='text ' data-title='anotherbigcoloumn'>another big coloumn</td>
              <td class='text ' data-title='small'>small</td>
            </tr>
          </tbody>
        </table>
      </div>
    </div></code>```

答:
Try this:

```<code><h3>Header
  <div>
    <div class='rg-container'>
      <div class='rg-content'>
        <table class='rg-table-head'>
          <thead>
            <tr>
              <th class='text '>id</th>
              <th class='text '>somcol</th>
              <th class='text '>biggger id</th>
              <th class='text '>another id</th>
              <th class='text '>med col</th>
              <th class='text '>med col</th>
            </tr>
          </thead>
        </table>
        <table class="rg-table-body">
          <tbody>

            <tr class=''>
              <td class='text ' data-title='id'>id</td>
              <td class='text ' data-title='somcol'>somcol</td>
              <td class='text ' data-title='biggger id'>biggger id</td>
              <td class='text ' data-title='another id'>another id</td>
              <td class='text ' data-title='med col'>med col</td>
              <td class='text ' data-title='med col'>med col</td>
              <td class='text ' data-title='sheet'>sheet</td>
              <td class='text ' data-title='sheet'>sheet</td>
              <td class='text ' data-title='anotherbigcoloumn'>another big coloumn</td>
              <td class='text ' data-title='small'>small</td>
            </tr>
          </tbody>
        </table>
      </div>
    </div>
</h3>
</code>```

CSS:

```<code>h3 table.rg-table-head {
  position: fixed;
}
h3 table.rg-table-body {
  padding-top: 1em;
}
</code>```

Here it is on CodePen.

Body:
please help, I have a html table , without changing the layout and responsive behavior - i want to make table header fixed - please suggest

https://codepen.io/shaswat/pen/EbwPNK

here want to implement table header and responsiveness of the table both together . which is not working

while scrolling down -- 3 headers and the table head should get fixed .

.rg-container {
  font-family: 'Lato', Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  margin: 0;
  padding: 1em 0.5em;
  color: #222;
}

.rg-header {
  margin-bottom: 1em;
  text-align: left;
}

.rg-header>* {
  display: block;
}

Some more Header information

Some more Header information

Header

              id
              somcol
              biggger id
              another id
              med col
              med col

              id
              somcol
              biggger id
              another id
              med col
              med col
              sheet
              sheet
              another big coloumn
              small

Body:
Try this:

<h3>Header
  <div>
    <div class='rg-container'>
      <div class='rg-content'>
        <table class='rg-table-head'>
          <thead>
            <tr>
              <th class='text '>id</th>
              <th class='text '>somcol</th>
              <th class='text '>biggger id</th>
              <th class='text '>another id</th>
              <th class='text '>med col</th>
              <th class='text '>med col</th>
            </tr>
          </thead>
        </table>
        <table class="rg-table-body">
          <tbody>

            <tr class=''>
              <td class='text ' data-title='id'>id</td>
              <td class='text ' data-title='somcol'>somcol</td>
              <td class='text ' data-title='biggger id'>biggger id</td>
              <td class='text ' data-title='another id'>another id</td>
              <td class='text ' data-title='med col'>med col</td>
              <td class='text ' data-title='med col'>med col</td>
              <td class='text ' data-title='sheet'>sheet</td>
              <td class='text ' data-title='sheet'>sheet</td>
              <td class='text ' data-title='anotherbigcoloumn'>another big coloumn</td>
              <td class='text ' data-title='small'>small</td>
            </tr>
          </tbody>
        </table>
      </div>
    </div>
</h3>

CSS:

h3 table.rg-table-head {
  position: fixed;
}
h3 table.rg-table-body {
  padding-top: 1em;
}

Here it is on CodePen.


问:
SignalR: webSockets timed out when trying to connect. Possible CORS issue
I am trying to write a mobile app (angular) that connects to an existing website that has a signalr hub. I have signalr configured on the web server:

```<code> // Branch the pipeline here for requests that start with "/signalr"
            app.Map("/signalr", map =>
            {
                // Setup the CORS middleware to run before SignalR.
                // By default this will allow all origins. You can
                // configure the set of origins and/or http verbs by
                // providing a cors options with a different policy.
                map.UseCors(CorsOptions.AllowAll);
                var hubConfiguration = new HubConfiguration
                {
                    // You can enable JSONP by uncommenting line below.
                    // JSONP requests are insecure but some older browsers (and some
                    // versions of IE) require JSONP to work cross domain
                    // EnableJSONP = true
                     EnableDetailedErrors = true
                };
                // Run the SignalR pipeline. We're not using MapSignalR
                // since this branch already runs under the "/signalr"
                // path.
                map.RunSignalR(hubConfiguration);
            });
</code>```

The server is running on site: http://localhost:62115/

I have another client application running on http://localhost:4434/ and I am trying to consume the signalr hub from http://localhost:62115/:

```<code>$.connection.hub.url = "http://localhost:62115/signalr/hubs";

        var queueProxy = $.connection.queueHub;

        $.connection.hub.logging = true;

        $.connection.hub.start()
            .done(function () {
                alert('yes');
            })
            .fail(function (e) {
                alert(e);
            });
</code>```

But signalr will not connect. I get the error No transport could be initialized successfully. Below is my log:

```<code>[16:19:58 GMT-0500 (Eastern Standard Time)] SignalR: Auto detected cross domain url.
jquery.signalR-2.1.1.js:81 [16:19:58 GMT-0500 (Eastern Standard Time)] SignalR: No hubs have been subscribed to.  The client will not receive data from hubs.  To fix, declare at least one client side function prior to connection start for each hub you wish to subscribe to.
jquery.signalR-2.1.1.js:81 [16:19:58 GMT-0500 (Eastern Standard Time)] SignalR: Negotiating with 'http://localhost:62115/signalr/hubs/negotiate?clientProtocol=1.4&connectionData=%5B%5D'.
jquery.signalR-2.1.1.js:81 [16:19:59 GMT-0500 (Eastern Standard Time)] SignalR: Connecting to websocket endpoint 'ws://localhost:62115/signalr/hubs/connect?transport=webSockets&clientProtocol=1.4&connectionToken=yNATl6%2FEQt710oI6ZGOV9%2F61Ry2SRjKQOgPDxKuXGSCYagKpbQKY5DOzRWdk1ggv6XaIm%2FJ2TUkkbmEkgCJyKHAKwy3ZweftP%2FYzRglLGe492Z4RDYY%2Btj8Aah3IhHIo&connectionData=%5B%5D&tid=2'.
jquery.signalR-2.1.1.js:81 [16:19:59 GMT-0500 (Eastern Standard Time)] SignalR: Websocket opened.
jquery.signalR-2.1.1.js:81 [16:20:04 GMT-0500 (Eastern Standard Time)] SignalR: webSockets timed out when trying to connect.
jquery.signalR-2.1.1.js:81 [16:20:04 GMT-0500 (Eastern Standard Time)] SignalR: Closing the Websocket.
jquery.signalR-2.1.1.js:81 [16:20:04 GMT-0500 (Eastern Standard Time)] SignalR: Attempting to connect to SSE endpoint 'http://localhost:62115/signalr/hubs/connect?transport=serverSentEvents&clie…AKwy3ZweftP%2FYzRglLGe492Z4RDYY%2Btj8Aah3IhHIo&connectionData=%5B%5D&tid=5'.
jquery.signalR-2.1.1.js:81 [16:20:04 GMT-0500 (Eastern Standard Time)] SignalR: EventSource connected.
jquery.signalR-2.1.1.js:81 [16:20:09 GMT-0500 (Eastern Standard Time)] SignalR: serverSentEvents timed out when trying to connect.
jquery.signalR-2.1.1.js:81 [16:20:09 GMT-0500 (Eastern Standard Time)] SignalR: EventSource calling close().
jquery.signalR-2.1.1.js:81 [16:20:09 GMT-0500 (Eastern Standard Time)] SignalR: Opening long polling request to 'http://localhost:62115/signalr/hubs/connect?transport=longPolling&clientPro…AKwy3ZweftP%2FYzRglLGe492Z4RDYY%2Btj8Aah3IhHIo&connectionData=%5B%5D&tid=6'.
jquery.signalR-2.1.1.js:81 [16:20:14 GMT-0500 (Eastern Standard Time)] SignalR: longPolling timed out when trying to connect.
jquery.signalR-2.1.1.js:81 [16:20:14 GMT-0500 (Eastern Standard Time)] SignalR: Aborted xhr request.
jquery.signalR-2.1.1.js:81 [16:20:24 GMT-0500 (Eastern Standard Time)] SignalR: Stopping connection.
jquery.signalR-2.1.1.js:81 [16:20:24 GMT-0500 (Eastern Standard Time)] SignalR: Fired ajax abort async = true.
</code>```

答:
I had this same issue.  The negotiation step would list out all the transport methods, but then 1 by 1 they would timeout (after 5 seconds for me).  Even long polling was broken.

In my case, we use Redis as a cache for SignalR.  My local copy worked fine since we have a conditional that only uses the Redis cache for prod.  So I figured it was something with that.

Updating all the related packages fixed the issue for me:

All of the Microsoft.AspNet.SignalR packages, including the client-side lib

All of the Microsoft.Owin packages

StackExchange.Redis

All of the Autofac packages (since AutoFac handled the Redis dependency being injected)

Body:
I am trying to write a mobile app (angular) that connects to an existing website that has a signalr hub. I have signalr configured on the web server:

 // Branch the pipeline here for requests that start with "/signalr"
            app.Map("/signalr", map =>
            {
                // Setup the CORS middleware to run before SignalR.
                // By default this will allow all origins. You can
                // configure the set of origins and/or http verbs by
                // providing a cors options with a different policy.
                map.UseCors(CorsOptions.AllowAll);
                var hubConfiguration = new HubConfiguration
                {
                    // You can enable JSONP by uncommenting line below.
                    // JSONP requests are insecure but some older browsers (and some
                    // versions of IE) require JSONP to work cross domain
                    // EnableJSONP = true
                     EnableDetailedErrors = true
                };
                // Run the SignalR pipeline. We're not using MapSignalR
                // since this branch already runs under the "/signalr"
                // path.
                map.RunSignalR(hubConfiguration);
            });

The server is running on site: http://localhost:62115/

I have another client application running on http://localhost:4434/ and I am trying to consume the signalr hub from http://localhost:62115/:

$.connection.hub.url = "http://localhost:62115/signalr/hubs";

        var queueProxy = $.connection.queueHub;

        $.connection.hub.logging = true;

        $.connection.hub.start()
            .done(function () {
                alert('yes');
            })
            .fail(function (e) {
                alert(e);
            });

But signalr will not connect. I get the error No transport could be initialized successfully. Below is my log:

[16:19:58 GMT-0500 (Eastern Standard Time)] SignalR: Auto detected cross domain url.
jquery.signalR-2.1.1.js:81 [16:19:58 GMT-0500 (Eastern Standard Time)] SignalR: No hubs have been subscribed to.  The client will not receive data from hubs.  To fix, declare at least one client side function prior to connection start for each hub you wish to subscribe to.
jquery.signalR-2.1.1.js:81 [16:19:58 GMT-0500 (Eastern Standard Time)] SignalR: Negotiating with 'http://localhost:62115/signalr/hubs/negotiate?clientProtocol=1.4&connectionData=%5B%5D'.
jquery.signalR-2.1.1.js:81 [16:19:59 GMT-0500 (Eastern Standard Time)] SignalR: Connecting to websocket endpoint 'ws://localhost:62115/signalr/hubs/connect?transport=webSockets&clientProtocol=1.4&connectionToken=yNATl6%2FEQt710oI6ZGOV9%2F61Ry2SRjKQOgPDxKuXGSCYagKpbQKY5DOzRWdk1ggv6XaIm%2FJ2TUkkbmEkgCJyKHAKwy3ZweftP%2FYzRglLGe492Z4RDYY%2Btj8Aah3IhHIo&connectionData=%5B%5D&tid=2'.
jquery.signalR-2.1.1.js:81 [16:19:59 GMT-0500 (Eastern Standard Time)] SignalR: Websocket opened.
jquery.signalR-2.1.1.js:81 [16:20:04 GMT-0500 (Eastern Standard Time)] SignalR: webSockets timed out when trying to connect.
jquery.signalR-2.1.1.js:81 [16:20:04 GMT-0500 (Eastern Standard Time)] SignalR: Closing the Websocket.
jquery.signalR-2.1.1.js:81 [16:20:04 GMT-0500 (Eastern Standard Time)] SignalR: Attempting to connect to SSE endpoint 'http://localhost:62115/signalr/hubs/connect?transport=serverSentEvents&clie…AKwy3ZweftP%2FYzRglLGe492Z4RDYY%2Btj8Aah3IhHIo&connectionData=%5B%5D&tid=5'.
jquery.signalR-2.1.1.js:81 [16:20:04 GMT-0500 (Eastern Standard Time)] SignalR: EventSource connected.
jquery.signalR-2.1.1.js:81 [16:20:09 GMT-0500 (Eastern Standard Time)] SignalR: serverSentEvents timed out when trying to connect.
jquery.signalR-2.1.1.js:81 [16:20:09 GMT-0500 (Eastern Standard Time)] SignalR: EventSource calling close().
jquery.signalR-2.1.1.js:81 [16:20:09 GMT-0500 (Eastern Standard Time)] SignalR: Opening long polling request to 'http://localhost:62115/signalr/hubs/connect?transport=longPolling&clientPro…AKwy3ZweftP%2FYzRglLGe492Z4RDYY%2Btj8Aah3IhHIo&connectionData=%5B%5D&tid=6'.
jquery.signalR-2.1.1.js:81 [16:20:14 GMT-0500 (Eastern Standard Time)] SignalR: longPolling timed out when trying to connect.
jquery.signalR-2.1.1.js:81 [16:20:14 GMT-0500 (Eastern Standard Time)] SignalR: Aborted xhr request.
jquery.signalR-2.1.1.js:81 [16:20:24 GMT-0500 (Eastern Standard Time)] SignalR: Stopping connection.
jquery.signalR-2.1.1.js:81 [16:20:24 GMT-0500 (Eastern Standard Time)] SignalR: Fired ajax abort async = true.


问:
Instantiate structure at assigned address (allocation assignment)
For a class I'm taking, we need to develop allocation utilities.

Safety aside, I will be using far pointers to receive and assign addresses to some structures. I am also not allowed to use "memalloc" in this assignment.

I referred to: Linked Lists in C without malloc
to learn how to make a linked structure without using memalloc. However, I need to know how I can assign a new instantiation to a particular address. For example, if I have a starting pointer to address 0x5000, I would like to create my list so that I can use an incremental offset (let's say 256 for example) to start my next structure 256 bytes ahead (in terms of address) of my starting point.

This assignment is based on becoming familiar with segmentation and the x86 architecture.

Any help is appreciated!

答:
Depending on what you want to do, you'll probably want to use a combination of the following tools:

Placement new: You can construct objects at specific memory locations by using the following syntax:

```<code>new (reinterpret_cast<void*>(0x500)) MyObject(/* ...ctor args... */);
</code>```

This does not allocate any new memory; instead it just calls the constructor using the specified memory address as the receiver object.  Be careful with alignment restrictions!

Custom allocators.  You can define a new class along the lines of std::allocator<T> that reserves memory in the spots you've indicated.  You can then create STL containers that automatically use memory in the locations you'd like.

ContentLicense: CC BY-SA 2.5

Body:
Depending on what you want to do, you'll probably want to use a combination of the following tools:

Placement new: You can construct objects at specific memory locations by using the following syntax:

new (reinterpret_cast<void*>(0x500)) MyObject(/* ...ctor args... */);

This does not allocate any new memory; instead it just calls the constructor using the specified memory address as the receiver object.  Be careful with alignment restrictions!

Custom allocators.  You can define a new class along the lines of std::allocator<T> that reserves memory in the spots you've indicated.  You can then create STL containers that automatically use memory in the locations you'd like.


问:
Why does django_tables2 render the same table twice?
I am using django_tables2 to create some tables. My app is called 'director' and I have a base template and then a child template that inherits from it. The code mostly works as expected--the child template is correctly inheriting the divss and stuff from the parent and the styling is right, but then the child also outputs the same table a second time, this time without the styling from the parent. I can't figure out for the life of me why the second table is getting generated.

Here is the base template.

```<code>#director_table.html
{% block content %}
<div class="container">
  <div class="row">
    <div class="col-lg-12 mb-4 mt-4">
        <div class="card h-100">
            <div class="card-header">List</div>
            <div class="card-body">
            <h4 class="card-title"></h4>
            <h6 class="card-subtitle"></h6>

                {% block table_stuff %}

                {% endblock %}
            </div>
        </div>
    </div>
 </div>
</div>
{% endblock %}
</code>```

And here's the child.

```<code>{% extends 'director/director_table.html' %}
    {% load render_table from django_tables2 %}
    {% block content %}
    {{ block.super }}

        {% block table_stuff %}
            {% render_table table %}
        {% endblock %}

    {% endblock %}
</code>```

edit

If I comment out the {% render_table table %} line, then I get 0 tables, not 2.

答:
Solved it. The solution was to divide the css/bootstrap stuff into further blocks.

the parent template:

```<code>{% block content %}
    {% block top %}
<div class="container">
    <div class="row">
        <div class="col-lg-12 mb-4 mt-4">
            <div class="card h-100">
                <div class="card-header">List</div>
                <div class="card-body">
                <h4 class="card-title"></h4>
                <h6 class="card-subtitle"></h6>
    {% endblock %}
                    {% block table_stuff %}

                    {% endblock %}
    {% block bottom %}
                </div>
            </div>
        </div>
    </div>
</div>
    {% endblock %}
{% endblock %}
</code>```

and the child:

```<code>{% extends 'director/director_table.html' %}
{% load render_table from django_tables2 %}
{% block content %}
    {% block top %}
    {{ block.super }}
    {% endblock %}
    {% block table_stuff %}
        {% render_table table %}
    {% endblock %}
    {% block bottom %}
    {{block.super}}
    {% endblock %}
{% endblock %}
</code>```

This gives the expected result.

Body:
I am using django_tables2 to create some tables. My app is called 'director' and I have a base template and then a child template that inherits from it. The code mostly works as expected--the child template is correctly inheriting the divss and stuff from the parent and the styling is right, but then the child also outputs the same table a second time, this time without the styling from the parent. I can't figure out for the life of me why the second table is getting generated.

Here is the base template.

#director_table.html
{% block content %}

List

                {% block table_stuff %}

                {% endblock %}

{% endblock %}

And here's the child.

{% extends 'director/director_table.html' %}
    {% load render_table from django_tables2 %}
    {% block content %}
    {{ block.super }}

        {% block table_stuff %}
            {% render_table table %}
        {% endblock %}

    {% endblock %}

edit

If I comment out the {% render_table table %} line, then I get 0 tables, not 2.

Body:
Solved it. The solution was to divide the css/bootstrap stuff into further blocks.

the parent template:

{% block content %}
    {% block top %}
<div class="container">
    <div class="row">
        <div class="col-lg-12 mb-4 mt-4">
            <div class="card h-100">
                <div class="card-header">List</div>
                <div class="card-body">
                <h4 class="card-title"></h4>
                <h6 class="card-subtitle"></h6>
    {% endblock %}
                    {% block table_stuff %}

                    {% endblock %}
    {% block bottom %}
                </div>
            </div>
        </div>
    </div>
</div>
    {% endblock %}
{% endblock %}

and the child:

{% extends 'director/director_table.html' %}
{% load render_table from django_tables2 %}
{% block content %}
    {% block top %}
    {{ block.super }}
    {% endblock %}
    {% block table_stuff %}
        {% render_table table %}
    {% endblock %}
    {% block bottom %}
    {{block.super}}
    {% endblock %}
{% endblock %}

This gives the expected result.


问:
Executing a homemade shell script inside a C program
I have a "test.sh" script and i need to run it inside a C program. Both files are in same folder. I've seen that people paste script code inside C program using #Define. I wonder if i can call that script without doing that. I'm looking for some function like "Call(test.sh)" inside C to execute and return the script. Any ideas?

Test script code:

```<code> echo "Hi, you're printing me from C program"
 exit 1
</code>```

Sorry, was kinda distracted! I'm working in ubuntu. I've done several scripts before and i need that script to re-execute my C program after it ends. I'm developing a simple game and i need the script to re-execute my program to play again without closing my terminal. Is this better clear? I'm doing it this way right now but is not working:

```<code>int main(){
 system("test.sh");
 return 0;
}
</code>```

terminal says:
     " sh: 1: test.sh: not found"

答:
Try

```<code>system("./test.sh");
</code>```

And make sure the file is executable and exists at the specified path. The above works only if the file is in the current working directory.

Body:
I have a "test.sh" script and i need to run it inside a C program. Both files are in same folder. I've seen that people paste script code inside C program using #Define. I wonder if i can call that script without doing that. I'm looking for some function like "Call(test.sh)" inside C to execute and return the script. Any ideas?

Test script code:

 echo "Hi, you're printing me from C program"
 exit 1

Sorry, was kinda distracted! I'm working in ubuntu. I've done several scripts before and i need that script to re-execute my C program after it ends. I'm developing a simple game and i need the script to re-execute my program to play again without closing my terminal. Is this better clear? I'm doing it this way right now but is not working:

int main(){
 system("test.sh");
 return 0;
}

terminal says:
     " sh: 1: test.sh: not found"

Body:
Try

system("./test.sh");

And make sure the file is executable and exists at the specified path. The above works only if the file is in the current working directory.


问:
Asterisk IP-PBX: API to set up and tear down a call between two extensions
I have a working system that controls a Cisco CUCM IP-PBX to set up and tear down a call between two parties A and B; it makes use of Java's JTAPI to:

make A call B

make B answer (pick up)

(wait for a few seconds)

make either A or B drop the call

Now I want to do the same with an Asterisk PBX (version 13.17.0). From what I have gathered, Asterisks JTAPI implementation doesn't work for recent Asterisks; the latest version that I can find, dates from 2006 and it seems to try and send AMI commands to which Asterisk replies something along the lines of "no such command" - I'm guessing the AMI syntax has changed over the years.

What I'm using now is a library called asterisk-java and more specifically, its AMI support. I'm sending an OriginateAction and the net effect is that:

Asterisk calls A

I have to pick up A's phone manually

A calls B

I have to pick up B's phone manually

finally a call is established between A and B

So instead of a fully automated process like in the Cisco case, I have to do manual work and I can't seem to find an API to just set up a call between A and B and having it drop after a couple of seconds.

Questions: is the AMI the correct API for my use case or is there a better alternative? And what API calls do I have to make to establish and drop a call?

Thanks,
Jan

答:
Does this answered question help with establishing a call without picking up:

Originate a call with Asterisk - without the originating extension ringing

To have a channel drop a call, using AMI, you can use 'BridgeKick' to boot a channel, or 'BridgeDestroy' to cause each channel to 'BridgeLeave':
https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+ManagerAction_BridgeKick


问:
Yii2, How can I set several values to a same attribute?
I would like to set a default filter to my gridview and I am not sure how.

I have this:

```<code>public function actionIndex()
    {

        $searchModel = new SearchParque();
        $searchModel->parada = 0;
        if (User::getCurrentUser()['username']=='vlc') {
            $searchModel->Provincia_Id = 10;
        }

       $dataProvider = $searchModel->search(Yii::$app->request->queryParams);

       return $this->render('index', [
            'searchModel' => $searchModel,
            'dataProvider' => $dataProvider,
        ]);
    }
</code>```

I want that Provincia_Id to have several values for a default filter.
Example the Provincia_Id has 10 as a value but also has 7.
Any Help?

答: You can add a new field ProvinciaIds to SearchParque class, add array validation rule for it, assign an array [10,7] to it in controller and add <code>->andFilterWhere(["Provinca_Id" => $this->ProvinciaIds])</code> to the query in search model. Use this field in search form view instead of Provincia_Id. </p>

Body:
I would like to set a default filter to my gridview and I am not sure how.

I have this:

public function actionIndex()
    {

        $searchModel = new SearchParque();
        $searchModel->parada = 0;
        if (User::getCurrentUser()['username']=='vlc') {
            $searchModel->Provincia_Id = 10;
        }

       $dataProvider = $searchModel->search(Yii::$app->request->queryParams);

       return $this->render('index', [
            'searchModel' => $searchModel,
            'dataProvider' => $dataProvider,
        ]);
    }

I want that Provincia_Id to have several values for a default filter.
Example the Provincia_Id has 10 as a value but also has 7.
Any Help?

Body: You can add a new field ProvinciaIds to SearchParque class, add array validation rule for it, assign an array [10,7] to it in controller and add ->andFilterWhere(["Provinca_Id" => $this->ProvinciaIds]) to the query in search model. Use this field in search form view instead of Provincia_Id.


问:
Extending a class that implements Serializable
If I extend a class that implements Serializable, do I need that class to also implement Serializable?

For instance if I have,

```<code>public class classToBeExtended implements Serializable
</code>```

Then will this suffice?

```<code>public class classThatWillExtend extends classToExtended
</code>```

Or do I need to do this?

```<code>public class classThatWillExtend extends classToExtended implements Serializable
</code>```

答:
If any of a class's superclasses implements a given interface, then the subclass also implements that interface.  Serializable is not special in that regard, so no, the subclasses of a Serializable class do not need to explicitly declare that they implement Serializable.  They can so declare, but doing that makes no difference.

The other implication is that if you extend a Serializable class, you should ensure that the subclass is indeed serializable itself.  For example, don't add non-transient fields of non-serializable types unless you're prepared also to add the necessary methods to support them.

Body:
If I extend a class that implements Serializable, do I need that class to also implement Serializable?

For instance if I have,

public class classToBeExtended implements Serializable

Then will this suffice?

public class classThatWillExtend extends classToExtended

Or do I need to do this?

public class classThatWillExtend extends classToExtended implements Serializable


问:
Using index during order by clause?
I  have created the index on created_date column of employee table but when i see the explain plan of below query
i do not see index being used. Why ?

```<code>    Select * from employee order by created_date desc;
</code>```

Per mine understanding, oracle will keep the created date in sorted fashion(using B tree) along with row id. So
why it does not use the already sorted data then fetch the other data using row id ?

If it does not use index then it will fetch all data in memory, then sort it and return it. Is n't it ?

答:
You must read all the rows from the base table, right? To read all of them from disk, the fastest way is to read them in bulk - block by block, regardless of their ordering on disk. This will minimize the number of reads from hard disk.

What you are proposing:

Look at the index. Find the rowid of the row with the most recent date and read that one row from disk. Then find the rowid of the next row and read that row from disk. Repeat. One read from disk for each row in the table.

Yes, in that way you have the rows ordered already (you avoid the CPU work to order the rows). But you have many more read operations from disk. Just to make up some numbers: you save 0.8 seconds of CPU work, and you increase I/O time by 40 seconds. (Purely made up, but probably the correct order of magnitude in the comparison.)

Title: Using index during order by clause?

Body:
I  have created the index on created_date column of employee table but when i see the explain plan of below query
i do not see index being used. Why ?

    Select * from employee order by created_date desc;

Per mine understanding, oracle will keep the created date in sorted fashion(using B tree) along with row id. So
why it does not use the already sorted data then fetch the other data using row id ?

If it does not use index then it will fetch all data in memory, then sort it and return it. Is n't it ?


问:
How to apply mix-blend-mode while keeping text opaque?
I need some help recreating this in CSS (if possible) :

And here is what I have so far:

.bg {
  background-image: url('https://images.unsplash.com/photo-1501706362039-c06b2d715385?auto=format&fit=crop&w=1070&q=60&ixid=dW5zcGxhc2guY29tOzs7Ozs%3D');
  background-repeat: no-repeat;
  background-position: center center;
  padding: 100px 50px;
}

.text {
  background: #ed1c24;
  mix-blend-mode: multiply;
}

.text p {
  font-family: "Helvetica";
  font-weight: bold;
  font-size: 32px;
  color: #fff;
  margin: 0;
  padding: 40px;
}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><div class="bg">
  <div class="text">
    <p>
      These artistic movements were a refelection of the million of people who lived and worked here. To them, "I ❤ NY" could be read as a rallying cry.
    </p>
  </div>
</div></code>```

There is a div with a background image and overlaying that div is another one with a red bg color and mix-blend-mode: multiply on it. It looks like the color blend is working correctly, but is there a way that I can make the white text be unaffected and an opaque solid white like in the example image?

答:
You may use pseudo element and apply mix-blend-mode: multiply on it like this :

.bg {
  background-image: url('https://images.unsplash.com/photo-1501706362039-c06b2d715385?auto=format&fit=crop&w=1070&q=60&ixid=dW5zcGxhc2guY29tOzs7Ozs%3D');
  background-repeat: no-repeat;
  background-position: center center;
  padding: 100px 50px;
}

.text {
  position: relative;
}

.text:before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  bottom: 0;
  background: #ed1c24;
  mix-blend-mode: multiply;
  z-index: 0;
}

.text p {
  font-family: "Helvetica";
  font-weight: bold;
  font-size: 32px;
  color: #fff;
  margin: 0;
  padding: 40px;
  z-index: 2;
  position: relative;
}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><div class="bg">
  <div class="text">
    <p>
      These artistic movements were a refelection of the million of people who lived and worked here. To them, "I ❤ NY" could be read as a rallying cry.
    </p>
  </div>
</div></code>```

ContentLicense: CC BY-SA 4.0

Body:
I need some help recreating this in CSS (if possible) :

And here is what I have so far:

.bg {
  background-image: url('https://images.unsplash.com/photo-1501706362039-c06b2d715385?auto=format&fit=crop&w=1070&q=60&ixid=dW5zcGxhc2guY29tOzs7Ozs%3D');
  background-repeat: no-repeat;
  background-position: center center;
  padding: 100px 50px;
}

.text {
  background: #ed1c24;
  mix-blend-mode: multiply;
}

.text p {
  font-family: "Helvetica";
  font-weight: bold;
  font-size: 32px;
  color: #fff;
  margin: 0;
  padding: 40px;
}

      These artistic movements were a refelection of the million of people who lived and worked here. To them, "I ❤ NY" could be read as a rallying cry.

There is a div with a background image and overlaying that div is another one with a red bg color and mix-blend-mode: multiply on it. It looks like the color blend is working correctly, but is there a way that I can make the white text be unaffected and an opaque solid white like in the example image?

Body:
You may use pseudo element and apply mix-blend-mode: multiply on it like this :

.bg {
  background-image: url('https://images.unsplash.com/photo-1501706362039-c06b2d715385?auto=format&fit=crop&w=1070&q=60&ixid=dW5zcGxhc2guY29tOzs7Ozs%3D');
  background-repeat: no-repeat;
  background-position: center center;
  padding: 100px 50px;
}

.text {
  position: relative;
}

.text:before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  bottom: 0;
  background: #ed1c24;
  mix-blend-mode: multiply;
  z-index: 0;
}

.text p {
  font-family: "Helvetica";
  font-weight: bold;
  font-size: 32px;
  color: #fff;
  margin: 0;
  padding: 40px;
  z-index: 2;
  position: relative;
}

<div class="bg">
  <div class="text">
    <p>
      These artistic movements were a refelection of the million of people who lived and worked here. To them, "I ❤ NY" could be read as a rallying cry.
    </p>
  </div>
</div>


问:
Filter array to have unique values
I need to filter out my array to contain only unique values.
this is my array data

```<code>["X_row7", "X_row4", "X_row6", "X_row10", "X_row8", "X_row9", "X_row11", "X_row7", "X_row4", "X_row6", "X_row10", "X_row8", "X_row9", "X_row11", "X_row7", "X_row4", "X_row6", "X_row10", "X_row8", "X_row9", "X_row11", "X_row7", "X_row4", "X_row6", "X_row10", "X_row8", "X_row9", "X_row11", "X_row7", "X_row4", "X_row6", "X_row10", "X_row8", "X_row9", "X_row11", "X_row7", "X_row4", "X_row6", "X_row10", "X_row8", "X_row9", "X_row11"]
</code>```

expected result should be

```<code>["X_row7", "X_row4", "X_row6", "X_row10", "X_row11", "X_row8", "X_row9"]
</code>```

How should i continue my code to get proper result.

```<code>newArray = [];
for(n in data){
  if(!newArray.indexOf(n)){
     newArray.push(n);
  }
}
console.log(newArray);
</code>```

If you need any additional information's please let me know and i will provide. thank you

答:
A slight variation on the indexOf method, if you need to filter multiple arrays:

```<code>function unique(item, index, array) {
    return array.indexOf(item) == index;
}
</code>```

Use as such:

```<code>arr.filter(unique);
</code>```

Title: Filter array to have unique values

Body:
I need to filter out my array to contain only unique values.
this is my array data

["X_row7", "X_row4", "X_row6", "X_row10", "X_row8", "X_row9", "X_row11", "X_row7", "X_row4", "X_row6", "X_row10", "X_row8", "X_row9", "X_row11", "X_row7", "X_row4", "X_row6", "X_row10", "X_row8", "X_row9", "X_row11", "X_row7", "X_row4", "X_row6", "X_row10", "X_row8", "X_row9", "X_row11", "X_row7", "X_row4", "X_row6", "X_row10", "X_row8", "X_row9", "X_row11", "X_row7", "X_row4", "X_row6", "X_row10", "X_row8", "X_row9", "X_row11"]

expected result should be

["X_row7", "X_row4", "X_row6", "X_row10", "X_row11", "X_row8", "X_row9"]

How should i continue my code to get proper result.

newArray = [];
for(n in data){
  if(!newArray.indexOf(n)){
     newArray.push(n);
  }
}
console.log(newArray);

If you need any additional information's please let me know and i will provide. thank you

Body:
A slight variation on the indexOf method, if you need to filter multiple arrays:

function unique(item, index, array) {
    return array.indexOf(item) == index;
}

Use as such:

arr.filter(unique);