• Resolved lesquealer

    (@lesquealer)


    Hi Tobias,

    I searched the forums quite a while before asking this question. And thanks so much for the great product and outstanding support! I’ve tried several things to reduce the width of my table but nothing seems to work. The table is at https://tennyhill.com/2016/09/29/testing-tablepress-calling-out-specific-table-with-shortcode/ and I have the following Custom CSS:
    .tablepress thead th,
    .tablepress tfoot th {
    background-color: #000000;
    font-family: Arial;
    text-align: center;
    font-size: 11px;
    color: #FFFFFF;
    }

    .tablepress .odd td {
    background-color: #FFFFFF;
    }

    .tablepress .even td {
    background-color: #FFDA8C;
    }

    .tablepress tbody td {
    font-family: Arial;
    font-size: 11px;
    color: #000000;
    }

    .tablepress border tr,
    tbody td,
    thead th,
    tfoot th {
    border-collapse: collapse !important;
    border-top: 1px solid #000000 !important;
    border-bottom: 1px solid #000000 !important;
    border-right: 1px solid #000000 !important;
    border-left: 1px solid #000000 !important;
    padding: 1px !important;
    border-color: #000000 !important;
    }

    .tablepress {
    padding: 1px;
    }

    .tablepress .column-2 {
    text-align: center;
    }

    .tablepress-id-5 .column-1 {
    width: 50px !important;
    }

    .tablepress-id-5 .column-2 {
    width: 50px !important;
    }

    I am trying to get the columns to have the width of the widest text entry and then those two columns will determine the overall table width. Right now it’s about 3 or 4 times the width it should be.

    Thanks so much in advance!

    Cindy

Viewing 10 replies - 16 through 25 (of 25 total)
  • Please see https://oldcookstove.com/wp/find-us/

    I have tried lots of the code I see on here. I basically want each column to take up 50% of the width. No matter what I do, nothing changes.

    Thank you in advance.

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi annasue,

    thanks for your question, and sorry for the trouble.

    Please add this to the “Custom CSS” textarea on the “Plugin Options” screen of TablePress:

    .tablepress-id-2 .column-1,
    .tablepress-id-2 .column-2 {
        width: 50%;
    }

    Please also remove the current “Custom CSS” for table 1, it contains some mistakes and will not work here.

    Regards,
    Tobias

    I’ve looked through this thread, sorry if I missed it…but I put in the CSS you recommended…

    .tablepress-id-1 .column-2 {
    padding: 10px;
    }

    .tablepress-id-1 .column-5 {
    width: 100px;
    }

    Because this 5th column here is too small, it looks weird with all the text.

    When I first load the page I see it trying to give the column 100px…but then it shrinks back down.

    What am I missing? Is there an auto width button somewhere that’s checked?

    Thank you!

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi rubyalice,

    Can you please post a link to the page with the table where this problem happens, so that I can take a direct look? Thanks!

    Regards,
    Tobias

    Whoops sorry! Meant to do that.

    https://www.oyh.org/past-grants/

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for the link!

    Your approach is fine from what I can see, but that value of 100px is just too small. Right now, that column actually has a width of 150px already, so you should try bigger values to make it wider.

    Now, the problem there will be that the other columns can not be made arbitrarily small. Their widths are limited by the overall table width (which is defined by the theme, as the size of the page), and by the width of the longest word in each column (which poses the lower limit for the column width).

    Furthermore, there is CSS in the Custom CSS of the theme that sets rather high padding values for the table – essentially “wasting” space in favor of more spacing between the columns. You might to adjust these values.

    Regards,
    Tobias

    Nothing was having any effect…but I unclicked the “Enable pagination of the table (viewing only a certain number of rows at a time) by the visitor.” option and the column just got bigger…with nothing special in the css field. Ah, technology!

    Thanks for your help!

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    weird… and interesting… ??
    Good to hear that you found a working solution!

    Best wishes,
    Tobias

    I am sorry for asking on the same dead thread, but I am out of options and I don’t know how to start a new one.

    https://thelionage.com/test-table/

    I really just want Column 25 and 29 to be wider, maybe column 23 and 24, too. I have tried editing the widths in every way I can, and I can’t seem to edit them.

    my ideal would be that the entire row is on 1-2 lines, so it’s clean to look at. I can’t seem to get the css to respond to me no matter how much I try, though.

    My only code currently is this, but I’ve tried several different ways to get it done to no avail.

    When I say 300px, it adjusts to a max of 118px in width or the like, and I can’t get it to go further by more than a pixel or two. T_T

    .entry .tablepress-id-2 {
    	width: auto;
    }
    
    .column-25 {
    	width: 300px !important;
    }
    
    .column-29 {
    	width: 300px !important;
    }
    
    .tablepress-id-2 {
    	font-size: .8em;
    }
    
    .tablepress thead th {
    	vertical-align: bottom !important;
    	text-align: center !important;
    }
    
    .tablepress th {
    	padding: 4px !important;
    }
    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    the commands look all correct, but I have no idea why they are not being interpreted ?? Sorry.

    Regards,
    Tobias

Viewing 10 replies - 16 through 25 (of 25 total)
  • The topic ‘Table Width’ is closed to new replies.