Skip to content

Issue with table wrapper in main.js #41

Closed
@GraydonGit

Description

@GraydonGit

Hi there,

I ran into a problem when I included more than four tables in a single blog post; they all appeared clustered together. It was quite odd, but I believe I've discovered a workaround.

At the end of the file changed:

main.js:

/* Responsive HTML table */
(function () {
    const tables = document.querySelectorAll('.gh-content > table:not(.gist table)');
    const wrapper = document.createElement('div');
    wrapper.className = 'gh-table';

    tables.forEach(function (table) {
        table.parentNode.insertBefore(wrapper, table);
        wrapper.appendChild(table);
    });
})();

TO:

/* Responsive HTML table */
(function () {
    const tables = document.querySelectorAll('.gh-content > table:not(.gist table)');

    tables.forEach(function (table) {
        const wrapper = document.createElement('div');
        wrapper.className = 'gh-table';
        table.parentNode.insertBefore(wrapper, table);
        wrapper.appendChild(table);
    });
})();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions