Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6830641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:38:30+00:00 2026-05-26T22:38:30+00:00

This code throws the error (in Chrome): Cannot find closing comment tag to match:

  • 0

This code throws the error (in Chrome): “Cannot find closing comment tag to match: ko foreach: MyPlans”:

<table>
  <!-- ko foreach: MyPlans -->
    <tr>
      <td>Test</td>
    </tr>
  <!-- /ko -->
</table>

If I use a list instead, everything works:

<ul>
  <!-- ko foreach: MyPlans -->
    <li>
      Test
    </li>
  <!-- /ko -->
</ul>

I would like to use the containerless foreach with a table. Is there something I’m doing wrong? Is it a bug?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T22:38:30+00:00Added an answer on May 26, 2026 at 10:38 pm

    This is related to the fact that browsers insert tbody tags automatically, which creates a mismatch in the comments. The rendered output will look like:

    <table>
      <!-- ko foreach: MyPlans -->
      <tbody>
        <tr>
          <td>Test</td>
        </tr>
      <!-- /ko -->
      </tbody>
    </table>
    

    Steve did put some work into trying to correct mismatched tags in KO, but the easiest thing for you to do is either add the tbody yourself or add the tbody and put your binding on it.

    <table>
      <tbody data-bind="foreach: MyPlans">
        <tr>
          <td>Test</td>
        </tr>
      </tbody>
    </table>
    

    It is legal for a table to have multiple tbody tags, if necessary.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This code throws an error Format exception. String must be exactly one character long.
This throws a DOM-related error (Uncaught Error: NOT_FOUND_ERR: DOM Exception 8 in Chrome): var
for some reason this code throws an error // map<int, AnItem> roomlist; // map<string,
This code does not throw an error but the query fails, that is, the
Hi I have below pseudo code with throws an exception like this throw new
Given this piece of code : public static void writeFile(File file,List buffer)throws IOException{ File
I am writing code that catches this OutOfMemoryException and throws a new, more intuitive
I have problem with this piece of code: var el = $('div#editor'); el.find('*[contentEditable]').removeAttr('contentEditable'); It
I am testing code in a MVC HTML helper that throws an error when
I have some code that throws causes syncdb to throw an error (because it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.