Okay
  Public Ticket #2385141
Column width
Closed

Comments

  • Eufemia Scarfone started the conversation

    I have gone through all the general and specific styling settings, but I haven't found an answer. I have a very wide table. It looks really ugly when I use the general settings for word wrap and limit table width. It also stretched the buttons into weird shapes and in some cases the whole button is not visible in the table. 
    What I want to do:

    I have several columns that I know will never be larger than 2 or 5 characters, for example. Is there a way to limit the size of only those columns? I also would need the column headers for these columns to wrap. 
    I don't see a way to set that per column. Am I missing something? Including a screenshot of my table so you can see what I mean. The year, and age columns will always be smaller than everything else. 

  •  2,572
    Aleksandar replied

    Hello Eufemia

    When you enable "Limit Table Width", every column gets a new option:

    6734610835.png

    If you enter the data like shown above, it will be considered as 100px, but you can also use %, so 25% would make that column take 25% width of the page.

    To wrap words in the header, you would need to add custom CSS in wpDataTables settings/Custom JS and CSS/Custom CSS field:

    table.wpDataTable th { white-space: normal !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