Hey there, Awesome Customers!

Just a heads up: We'll be taking a breather to celebrate International Workers' Day (May 1st and 2nd - Wednesday and Thursday) and Orthodox Easter from Good Friday (May 3rd) through Easter Monday (May 6th). So, from May 1st to May 6th, our team will be off enjoying some well-deserved downtime.

During this time, our customer support will be running on a smaller crew, but don't worry! We'll still be around to help with any urgent matters, though it might take us a bit longer than usual to get back to you.

We'll be back in action at full throttle on May 7th (Tuesday), ready to tackle your questions and requests with gusto!

In the meantime, you can explore our documentation for Amelia and wpDataTables. You'll find loads of helpful resources, including articles and handy video tutorials on YouTube (Amelia's YouTube Channel and wpDataTables' YouTube Channel). These gems might just have the answers you're looking for while we're kicking back.

Thanks a bunch for your understanding and support!

Catch you on the flip side!

Warm regards,

TMS

Okay
  Public Ticket #2340712
How to customize cell contents
Closed

Comments

  • fangquans started the conversation

    Dear support,

    I have a broad question on how to customize cell contents. This includes font size, alignment, margins, paddings, text size, image size, text color, background color of each cell or row.

    Is there any documentation?? 

  •  2,498
    Aleksandar replied

    Hello fangquans

    Unfortunately, there isn't any documentation with detailed instructions on how you can do this, but if what you're looking for isn't found in "Settings/Color and font settings", you can do it with custom CSS.

    For example, you can add a Custom CSS Class to the column, which is meant to call on a class which you would define in Custom CSS field in main settings of wpDataTables.

    So, if you were to name the class "color1", you should go to main settings/Custom JS and CSS/Cusom CSS, and enter this:

    table.wpDataTable td.color1 {
    color: red !important;
    }

    For table headers, you can find the column name in the column settings:

    6037346968.png

    Then add the following CSS:

    .wpdt-c th.column-product {
    background-color: red !important;
    }

    My test table has columns "Name", "Product", "Date" and "Image", so my CSS would look like this:

    .wpdt-c th.column-name {
    background-color: gray !important;
    }
    .wpdt-c th.column-product {
    background-color: red !important;
    }
    .wpdt-c th.column-date {
    background-color: blue !important;
    }
    .wpdt-c th.column-image {
    background-color: wheat !important;
    }

    And the outcome would be:

    9987106445.png

    If you want to apply this to all tables, you can paste the CSS in Custom CSS field in Custom JS and CSS tab in main settings of wpDataTables. If, however, you wish to apply this only to a certain table on front-end, you need to add it when you're creating the page, above the shortcode, in between the <style>...</style> tags, like this:

    <style>
    .wpdt-c th.column-name {
    background-color: gray !important;
    }
    .wpdt-c th.column-product {
    background-color: red !important;
    }
    .wpdt-c th.column-date {
    background-color: blue !important;
    }
    .wpdt-c th.column-image {
    background-color: wheat !important;
    }
    </style>
    [wpdatatable id=1]
    

    Of course, you can add "color" instead of "backgroung-color" if you wish to change the font color.

    I hope this helps.

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    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

  • fangquans replied

    HI Aleksandar,

    The color setting kind of works for me. Can you give an example of aligning the text?? I use the follow css, but it doesn't seem to work

    table.wpDataTable td{
      text-align: center;
    }
  •  2,498
    Aleksandar replied

    Hi again fangquans

    You can use the same class you used for the color.

    For example:

    table.wpDataTable td.color1 {
    color: red !important;
    text-align: center !important;
    }


    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    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