Hey everyone!

With the holiday season upon us, we want to share our upcoming working hours:

After that, we’ll return to our regular schedule and assist you as quickly as possible.

In the meantime, you can explore our documentation for Amelia and wpDataTables. You'll find tons of helpful resources, including articles and handy video tutorials on YouTube (Amelia's YouTube Channel and wpDataTables' YouTube Channel), which might just have the answers you need while we’re away.

Thanks a bunch for your understanding and support!

Warm regards and happy holidays!

TMS

Okay
  Public Ticket #3517734
Table padding not showing on homepage
Closed

Comments

  • Morten Sterregaard-Feltsen started the conversation

    Hi,

    Can you look into why the padding I have added to my tables with custom CSS is showing/working in the table example in WordPress but not showing on the webpage?

    I kind of only get the standard padding on the webpage even if I change it to for instance 50px and the table looks all crazy in the WordPress example.

    FYI: It's not an attractive solution for me to use CSS classes as they are removed for each column when there's a change in the header - which we have once a month.

    You can see the table on our frontpage.

    The table has the following custom CSS:

    /* Makes table data cells of last column left border 1px dashed blue */
    table.wpDataTable td:nth-child(6) {
        border-left: 1px dashed #113049 !important;
        }
    /* Forces blue 2px left border on all other columns */
    table.wpDataTable th:nth-child(1),
    table.wpDataTable td:nth-child(1),
    table.wpDataTable th:nth-child(2),
    table.wpDataTable td:nth-child(2),
    table.wpDataTable th:nth-child(3),
    table.wpDataTable td:nth-child(3),
    table.wpDataTable th:nth-child(4),
    table.wpDataTable td:nth-child(4),
    table.wpDataTable th:nth-child(5),
    table.wpDataTable td:nth-child(5),
    table.wpDataTable th:nth-child(6) {
        border-left: 2px solid #113049 !important;
        }
    /* Forces center in column 2-6 */
    table.wpDataTable th:nth-child(2),
    table.wpDataTable td:nth-child(2),
    table.wpDataTable th:nth-child(3),
    table.wpDataTable td:nth-child(3),
    table.wpDataTable th:nth-child(4),
    table.wpDataTable td:nth-child(4),
    table.wpDataTable th:nth-child(5),
    table.wpDataTable td:nth-child(5),
    table.wpDataTable th:nth-child(6),
    table.wpDataTable td:nth-child(6) {
        text-align: center !important;
        }
        
    /* Adds padding in all cells - but not working on homepage */   
    table.wpDataTable th,
    table.wpDataTable td {
        padding-right: 15px !important;
        padding-left: 15px !important;
        padding-top: 15px !important;
        padding-bottom: 15px !important;
        }
    

    We have the following custom CSS in the wpDataTables settings. I can't see that it creates any conflicts:

    /* Forces Mulish font on all tabel th and td */
    table.wpDataTable th, 
    table.wpDataTable td {
        font-family: Mulish !important;
    }
    /* Forces bold font on all th */
    table.wpDataTable th {
        font-weight: bold !important;
    }
    /* Forces blue 2px outer border on all tables */
    table.wpDataTable {
        border: 2px solid #113049 !important;
       }
    /* Forces blue 2px header bottom-border on all tables */
    table.wpDataTable th {
        border-bottom: 2px solid #113049 !important;
    }
    /* Removes the white frame/padding around all tables */
    .wpDataTablesWrapper {
        padding: 0 !important;
        padding-top: 0 !important;
        padding-right: 0 !important;
        padding-bottom: 0 !important;
        padding-left: 0 !important;
    }
    /* Removes the white frame/padding around all tables */
    .wpDataTablesWrapper table.wpDataTable {
        margin: 0 auto !important;
        margin-top: 0 auto !important;
        margin-right: 0 auto !important;
        margin-bottom: 0 auto !important;
        margin-left: 0 auto !important;
        width: 100% !important;
        padding: 0 !important;
    }
    /* Removes wrong blue bottom border on all table headers */
    .wpdt-c .wpDataTablesWrapper table.wpDataTable thead th {
        border-bottom: 1px solid #113049 !important;
    }
    /* Removes top white frame on mobile around all tables */
    @media screen and (max-width: 769px)
    {.wpdt-c.wdt-skin-aqua .wpDataTablesWrapper div.dt-buttons {
        margin-top: 0 !important;
        padding-top: 0 !important;
        display: none !important;
    }}
    

    Best regards,

    Morten

  •  1,847
    Miloš replied


    Hi Morten,

    Firstly, I would like to sincerely apologize for the delayed response as we have been experiencing an unusually high number of tickets. I am sorry that it has taken longer than usual to respond to your concern and your patience is highly appreciated.

    1. For the table data selector/ the style for the cells, try this :

    .wpDataTablesWrapper table.wpDataTable > tbody > tr > td {
        padding-right: 15px !important;
        padding-left: 15px !important;
        padding-top: 15px !important;
        padding-bottom: 15px !important;
        
    }

    It seems the CSS selector you made is not 'fully affecting' the Table cells as it should be.

    That can happen if some other style, either from another Custom CSS or perhaps something from your Theme or another Plugin might override it on front-end;

    Especially if you see the Table on the back-end applying the correct style - then it is certainly some kind of conflict that overrides just the front-end.

    But by creating this kind of a selector, which is kind of 'targeting' a specific element with 'more accuracy' , it can override it.

    It works in the Magic CSS Editor ( A Chrome extension i use for testing) when i try it directly on my Chrome Browser and your Page :

    1610191490.png

    2. For the Header selector, try this :

    .wpdt-c .wpDataTablesWrapper table.wpDataTable thead th {
        padding-right: 15px !important;
        padding-left: 15px !important;
        padding-top: 15px !important;
        padding-bottom: 15px !important;
    }


    1824386001.png


    I found another selector, for example if you wish to add a Table ID in the mix, then you can add this in the Main Plugin Settings/Custom JS and CSS/Custom CSS and just input a specific Table ID, if you need it different for specific Tables without having to input it in each Table Customize, but rather all in the Main Plugin Settings, if that might help :


    For the Header row :

    .wpdt-c .wpDataTablesWrapper table.wpDataTable.wpDataTableID-38 > thead > tr > th {
        padding-right: 15px !important;
        padding-left: 15px !important;
        padding-top: 15px !important;
        padding-bottom: 15px !important;
    }


    For the Cell Data ( even rows) :

    .wpdt-c .wpDataTablesWrapper table.wpDataTable.wpDataTableID-38 tr.even td {
        
    }


    For the Cell Data ( odd rows) :

    .wpdt-c .wpDataTablesWrapper table.wpDataTable.wpDataTableID-38 tr.odd td {
        
    }


    I hope that helps.


    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  • Morten Sterregaard-Feltsen replied

    Thx Milos!

    This is so weird.

    It's not not working on the frontpage (table 38) here. But it's working here and here (table 13, 14, 50 and 51).

    The CSS below is inserted in the general settings. Makes no difference if I insert in the custom CSS for table 38.

    Best,

    Morten

    /* Sets the desired right, left, top and bottom padding in the chosen desktop tables  */
    .wpdt-c .wpDataTablesWrapper table.wpDataTable.wpDataTableID-13 > thead > tr > th,
    .wpdt-c .wpDataTablesWrapper table.wpDataTable.wpDataTableID-13 > tbody > tr > td,
    .wpdt-c .wpDataTablesWrapper table.wpDataTable.wpDataTableID-14 > thead > tr > th,
    .wpdt-c .wpDataTablesWrapper table.wpDataTable.wpDataTableID-14 > tbody > tr > td,
    .wpdt-c .wpDataTablesWrapper table.wpDataTable.wpDataTableID-38 > thead > tr > th,
    .wpdt-c .wpDataTablesWrapper table.wpDataTable.wpDataTableID-38 > thead > tr > th,
    .wpdt-c .wpDataTablesWrapper table.wpDataTable.wpDataTableID-50 > tbody > tr > td,
    .wpdt-c .wpDataTablesWrapper table.wpDataTable.wpDataTableID-50 > tbody > tr > td,
    .wpdt-c .wpDataTablesWrapper table.wpDataTable.wpDataTableID-51 > thead > tr > th,
    .wpdt-c .wpDataTablesWrapper table.wpDataTable.wpDataTableID-51 > tbody > tr > td {
        padding: 15px !important;
    }
    
  •  1,847
    Miloš replied

    Hi Morten,

    Apologies again for the delayed reply.

    Thank you for all your patience.

    -

    Yes, it does look strange.

    I found there are some CSS styles being called on that first Page where Table 38 is, check on my screenshot.

    You can also try to check this, if you inspect the HTML of the Page, and type in "padding" as filtered value of the CSS.  The first section of the CSS seems to be overriding all the padding in that Table :

    6846335808.png

    When we compare it to another Page - where it works OK, this is the first line of CSS that has any "padding" filtered in it.

    And that is the Custom CSS you added on purpose , for those Table ID's, they are being respected on that Page without any additional CSS overriding them.

    5624125026.png

    Can you check did you add any "Additional CSS"  to that first Page somewhere, through the Page builder's "Customize" section, perhaps?

    Someone from your end must have added that Style, it has a comment above that says :

    /* Forces the right padding on all columns */

    And it is as on my image here , being added to your Page :

    1429428067.png

    Can you check, try to find where you/or someone else from your end has added these lines of CSS, and do you need them?

    If you don't need them, it is best to remove that section, then it should resolve the issue of overriding these new 'padding' lines we are trying to do.

    Let me know if that helps.

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  •  1,847
    Miloš replied

    Hi Morten,

    Sorry, i forgot to add one detail.

    If you find where that CSS Section is coming from - and maybe if you need those to be set, but to have higher importance on these new lines we are setting;

    Then you can just try to remove the !important clause from those other CSS lines - and leave the !important clause just on this latest CSS - so it should have higher importance then.

    I hope that helps.

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  • Morten Sterregaard-Feltsen replied

    Hi Milos,

    I found out where the CSS comes from...it comes from table 39 which is a table showing the same data but customized for the tablet and mobile version of the site. 

    So, table 38 shows on desktop but is hidden on tablet and mobile and table 39 is hidden on desktop but shows on tablet and mobile. 

    The difference was that table 39 had the padding CSS in its own custom CSS (because its the only table using that specific padding), whereas all other tables had the padding CSS in the general settings CSS (because more tables share it).

    Looks like its working now!! :-)

    Thx for the help and effort!! :-) 

  •  1,847
    Miloš replied

    Hi Morten,

    Just following up, once again I want to extend my heartfelt apologies for the delayed reply, 

    which is due to an unexpectedly high volume of inquiries. 

    We truly value your patience during this period.

    I am delighted to hear that this has been resolved. Thank you for letting us know. Anything else that we could assist with, please don't hesitate to create new tickets.

    Have a great day!smile.png


    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables