When loading a table, the timestamp flashes

[ad_1]

Thread Starter
Leo.Lin

(@bi1012037)

I have found a CSS + JS solution to solve this flickering issue.

posts-data-table-main.css

table.posts-data-table {
    ...
    ...
    opacity: 0;
}

Add this kind of JavaScript logic inside function.php.

var postsTable = document.querySelector("#posts-table-1");
if (postsTable) {
    setTimeout(function() {
        var timestampTh = postsTable.querySelector('th[data-name="timestamp"]');
        var titleTh = postsTable.querySelector('th[data-name="title"]');
        if (titleTh && !timestampTh && postsTable.style.opacity !== "1") {
            postsTable.style.opacity = 1;
        }
    }, 100);

The final screen recording result.

  • This reply was modified 43 seconds ago by Leo.Lin.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer