Viewing 15 replies - 1 through 15 (of 19 total)
  • Thread Starter BissWordpress

    (@bisswordpress)

    I forgot to say that there were 2 columns I deleted them in that table and I saved it.

    Maybe that’s the reason? I important an English table and there were 2 unneeded table so I deleted them!

    All only want these columns.

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    thanks for your post. Good to hear that you like the plugin!

    The width of the columns are determined by the browser automatically, based on the number of columns in the table, and on the contents in the table.

    To make them all same width, you’ll need some CSS code. And you actually know that CSS code already, as you are already using it.
    Unfortuantely though, there’s no way to do this with a single piece of code for all tables, because the number of columns decided what the exact percentage values need to be.
    So, at first, delete this “Custom CSS”:

    .tablepress .column-1,
    .tablepress .column-2 {
    	width: 50% !important;
    }
    
    .tablepress .column-3,
    .tablepress .column-4 {
    	width: 50% !important;
    }

    This will not work, as it would in total set a column width of 200% to a table with four columns.

    Instead, you will need to use something like this (which you are already using):

    .tablepress-id-51 .column-1,
    .tablepress-id-51 .column-2,
    .tablepress-id-51 .column-3,
    .tablepress-id-51 .column-4 {
    	width: 25% !important;
    }

    Now, this can hwoever be optimized a little bit. Instead of duplicating the CSS selector, you can shorten this to

    .tablepress-id-51 th
    .tablepress-id-51 td {
    	width: 25% !important;
    }

    So, for every table with four columns, you would just that. For a column with five columns, you would instead use this (because 100% divided by 5 is 20%):

    .tablepress-id-123 th
    .tablepress-id-123 td {
    	width: 20% !important;
    }

    Regards,
    Tobias

    Thread Starter BissWordpress

    (@bisswordpress)

    Tobias, I think you are genius.

    But dude, you said the width are automatically detected by the browser. But why the width in my table are not the same?

    Thanks!

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    the widths in your table are not the same because the content in the column has different widths, and because of the CSS code from above that I asked you to delete. That influences the browser so that the columns get different widths. To have the columns have the same width, just follow my code suggestion from above for all of your tables.

    Regards,
    Tobias

    Thread Starter BissWordpress

    (@bisswordpress)

    Tobias, thanks a lot.

    Does adding more CSS make the website slower? or it doesn’t matter? 🙂

    Thread Starter BissWordpress

    (@bisswordpress)

    Haha 🙂

    http://www.f1arab.com/mugello-test/

    Tobias, as you are always helping me. I was wondering I have 22 rows coming next weekend and I need like 3 tables every week with 22 rows, I was wondering how is it possible to decrease the height of these tables a little bit? so people can go down on the page and comment. Because I tested it and the table was very big.

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    no problem!

    Don’t worry about the CSS making your site slower. That will only happen for very, very many tables that each have CSS.

    To reduce the height of rows, you can decrease the padding in them:

    .tablepress th,
    .tablepress td {
        padding: 4px;
    }

    Regards,
    Tobias

    Thread Starter BissWordpress

    (@bisswordpress)

    Thanks a lot.

    Tobias do you remember, I asked about how to copy tables in WordPress? Well you told me to copy and paste this manually:

    http://www.autosport.com/news/report.php/id/105821

    It didn’t work out. All the times and names were in the same column.

    I tried this table manually and it worked perfectly:

    http://www.f1zone.net/news/webber-fastest-on-opening-day-in-barcelona/17923/

    But is it possible to get the content from the first link? that would be mega 🙂

    Thanks!

    Thread Starter BissWordpress

    (@bisswordpress)

    Tobias,

    I found a solution and I used another website. But there’s a small problem. I like the height of the tables so I found at the options I can show limited number of rows I did that.

    Use datatables is enabled.
    Sorting, pagination..are enabled.

    But the table is normal. Do I need to install something else?

    http://www.f1arab.com/mugello-test/

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    for copying that table from the first link: No sorry, I don’t have a solution to that. The problem with that is that this is not really a table (in the code). It is just text that looks like a table.

    About the problem with the pagination: The problem here is a JavaScript error in another JS file on the site, from your theme, as it seems. That breaks, and due to that, the browser stops executing all JavaScript.
    The error is Uncaught TypeError: Cannot read property 'offsetParent' of undefined in line 35 of the file http://grid.f1arab.com/wp_ar/wp-content/themes/f1arabv2013/js/stepcarousel.js
    Once you fix that, or remove that, the JS will work.

    Regards,
    Tobias

    Thread Starter BissWordpress

    (@bisswordpress)

    Tobias, If I donate a small amount could you help me to fix that?

    Because I don’t know how to deal with JS files.

    Thanks!

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    I’m really sorry, but I’m also not that much of an expert in JS and don’t really see why this happens. As this is a problem in your theme, you should probably contact the developer of your theme. And actually, I just spotted another problem:
    The theme makes WordPress load a very old version of the jQuery JavaScript library from the Google CDN, instead of simply using the up-to-date version that ships with WordPress. This is also bound to cause trouble with other plugins (including TablePress).
    You’ll therefore really need to get your theme updated…

    Regards,
    Tobias

    Thread Starter BissWordpress

    (@bisswordpress)

    Tobias,

    All good now 🙂 gonna donate this week – man this table is so goood!!

    I have a question:

    Do you see the top of the table at the left? there are entries 10,25,100..how can i put 12, 22 only? and change the text of Arabic? because I want to use my own text?

    At the bottom of the table, do you see previous and next? they’re not good in Arabic. How can i fix that too? (bottom-right)

    http://www.f1arab.com/reports-results/29840/

    Thanks 😀

    Thread Starter BissWordpress

    (@bisswordpress)

    The arrows are going in the wrong direction..

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    good to hear that the sorting works now 🙂
    Thanks for wanting to donate, I really appreciate it!

    About the other questions:

    Only 12 and 22: Yes, that’s possible. Please add this to the “Custom Commands” textfield on the “Edit” screen of the table”

    "aLengthMenu": [12, 22]

    For the Arabic: I’m confused. For me this appears in Arabic, already?! But you can change these strings easily by using this Extension for TablePress: http://tablepress.org/extensions/change-datatables-strings/

    About the arrows: Yes, that’s messed up a little bit, and I need to fix that for right-to-left languages. Until I find a fix, please add this to the “Custom CSS” textarea:

    .dataTables_paginate {
      direction: ltr;
    }

    That should at least make the text readable and usable.

    Regards,
    Tobias

Viewing 15 replies - 1 through 15 (of 19 total)

The topic ‘Same width’ is closed to new replies.