Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Unexpected closing tag of div element

I want to insert a div inside the table element as the following fiddle

Code:

 <table class="table table-striped">
        <thead>
          <tr>
            <th scope="col">#</th>
            <th scope="col">User</th>
            <th scope="col" class="text-center">Test</th>
            <th></th>
          </tr>
        </thead>
        <tbody>
          <tr *ngFor="let item of filteredItems$ | async; index as i">
            <th scope="row">1</th>
            <td>
            Test
            </td>
            <td>
              <ul class="timeline" id="timeline">
                <li class="li complete">
                  <div class="timestamp">
                    <span class="author">Abhi Sharma</span>
                    <span class="date">11/15/2014<span>
                  </div>
                  <div class="status">
                    <h4> Shift Created </h4>
                  </div>
                </li>
                <li class="li complete">
                  <div class="timestamp">
                    <span class="author">PAM Admin</span>
                    <span class="date">11/15/2014<span>
                  </div>
                  <div class="status">
                    <h4> Email Sent </h4>
                  </div>
                </li>
                <li class="li complete">
                  <div class="timestamp">
                    <span class="author">Aaron Rodgers</span>
                    <span class="date">11/15/2014<span>
                  </div>
                  <div class="status">
                    <h4> SIC Approval </h4>
                  </div>
                </li>
               
               </ul>      
            </td>
          </tr>
        </tbody>
      </table>

But it is returning an error of unexpected closing tag.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Uncaught Error: Template parse errors: Unexpected
closing tag "div". It may happen when the tag has already been closed
by another tag.

I can not find why, because all my div are closed, someone knows what am I doing wrong?

>Solution :

You are not closing the span tag in the following line in each of the li’s

<span class="date">11/15/2014<span>

it should be (note – you will need to update each of the 3 instances)

<span class="date">11/15/2014</span>

When you see the closing tag error – go through your code to check that all tags have been closed – it may not be the item that was listed in the error… js tries to infer closing tags when they are missing and the one identified may simply be at the end of that guess.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading