How to add row to a table in jQuery?

Three approaches with code examples about how to add row to a table in jQuery
31 October 2017   2664

You can use this approach:

$('#myTable tr:last').after('<tr>...</tr><tr>...</tr>');

You can include anything within the after() method as long as it's valid HTML, including multiple rows as per the example above.

You can also use this:

$('#myTable > tbody:last-child').append('<tr>...</tr><tr>...</tr>');

And the last one approach:

$("#tableID").find('tbody')
    .append($('<tr>')
        .append($('<td>')
            .append($('<img>')
                .attr('src', 'img.png')
                .text('Image cell')
            )
        )
    );

 The $('<some-tag>') is a tag object that can have several attr attributes that can be set and get, as well as text, which represents the text between the tag here: <tag>text</tag>.

Frontend News Digest 5 - 11.10

Three dots in JavaScript, when to use map instead of plain JS object, how to make first React Nattive app and much more
11 October 2019   114

Greetings! I hope your week went great! Here's new Frontend news digest.

One of the greatest things is this digest for newbies is a guid on how to create your first React Native app. Others may learn about the latest NestJS Addons: In-Memory DB update, three dots in JavaScript and interview with "adult" website dev

Guides

  • Clipping, Clipping, and More Clipping! 

Guide on how to use the CSS clip-path property to create interesting effects.

  • Trying to Make Sense of Gmail CSS Support

Highly specialized, but valuable for some specialists guide

  • The tale of three dots in Javascript

Tutorial about the usage of "three consecutive dots" in JS

  • When to Use Map instead of Plain JavaScript Object

Everything should be understandable from the heading, I believe.

  • How to make your first React Native app

You gonna learn how to create a new mobile appl using React Native Starter

Articles

  • ASPIRE: Ideals to Aspire to When Building Websites

Skilled developer made the case that sites should aspire to be Accessible, Secure, Performant, Inclusive, Responsive and Ethical.

  • Interview with Pornhub Team developer

Interesting interview with a guy that works for one of the most popular "adult" websites

  • Verify Phone Numbers On The Web with The SMS Receiver API

Preview of the in-development SMS Receiver API

Updates

  • Node Code Formatter

Automatically formats your code with your preferred code formatter

  • NestJS Addons: In-Memory DB

New version with built-in entity CrUD Controllers, whatever they are