title: In Angular Table how to set focus to move next row when we enter value in last cell of first row then press Enter key
body: <p>Issue: For first row by default focus is coming by default When there is no next cell in first row, focus should move to next row.</p>
  <pre><code>    &lt;!-- HTML file--&gt;
        &lt;tbody&gt;
                  &lt;tr *ngFor=&quot;let row of rows;let i=index;&quot; [class.selectedRow]=&quot;rowIsSelected(row)&quot; [class.active]=&quot;isContainerSelected(row)&quot; style=&quot;cursor: pointer;&quot;&gt;
                      &lt;td contenteditable=&quot;true&quot; (keydown.enter)=&quot;catchScaningId($event)&quot;&gt;&lt;/td&gt;
                      &lt;td contenteditable=&quot;true&quot; (keydown.enter)=&quot;cellChanged($event)&quot;&gt; &lt;/td&gt;
                  &lt;/tr&gt;
              &lt;/tbody&gt;
      
     
  </code></pre>
  <p>// .TS file
  // Once first row last cell completed focus is not moving to next row</p>
  <pre><code>   catchScaningId(event: any) {
             this.setFocus(event);
        }
     cellChanged(event: any) {
            this.setFocus(event);
         }
          
     setFocus(event: any) {
              let element;
              if (event.code === 'Enter')
                element = event.srcElement.nextElementSibling;
              if (element == null) {
              event.preventDefault();
                         
          //TODO: element.focus();  // When there is no next cell, focus should move to next row
              }   else {
                    event.preventDefault();
                    element.focus();
                  }
          
            }
  </code></pre>