Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    Can you please clarify what exactly you would like to adjust in the table on your site? I assume that you are not happy with the column widths. This is likely caused by the last column, which only contains a very long URL. You could maybe try turning that into a clickable link with a short link text like “Info”, via the “Insert Link” button below the table input fields.

    Regards,
    Tobias

    Thread Starter awjensen

    (@awjensen)

    That would mean I would have to go the very cumbersome process of creating a link in about 120 cells. For each cell, that means I have to:
    – Cut the existing link from the cell
    – Scroll down to the bottom of the table
    – Click the “Insert link” button
    – Scroll up to the cell where I want to insert the link
    – Click to create the link.

    Are you ABSOLUTELY SURE that the column width issue is caused by these links? If so, isn’t there a less cumbersome way of creating these links? Even having a copy of the “Insert link” button at the top of the table would help.

    Thread Starter awjensen

    (@awjensen)

    Missed a step: After clicking the “Insert image” button, I have to click “OK” to dismiss the instructional popup! Crazy.

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    yes, I’m pretty sure that the URLs are heavily influencing your table’s column widths. The browser treats them as one very long word, which results in a wide column.

    Regarding that described workflow: In principle, you are right, but there are few options: You could move the “Table Manipulation” section above the “Table Content” section, via the arrows in the section’s top right corner. And that instructional popup will only appear once per page load, so you won’t have to confirm it again and again for every link 🙂
    To make things faster, the essential question is: Do you want use the same link text with all URLs (which I would recommend here)? Then, you could
    – use copy/paste to insert <a href=" before each URL, and ">Link text</a> (with the desired link text) after the URL,
    – or do this after exporting the table as a CSV file in Excel or a text editor (where you can use search/replace maybe),
    – or use a JavaScript-based solution, so that no actual content changes are needed. For that, see https://ww.wp.xz.cn/support/topic/changing-links-to-click-here-for-an-entire-column/

    Regards,
    Tobias

    Thread Starter awjensen

    (@awjensen)

    Thanks for your reply. Although I know nothing about JavaScript, I would like to try that solution. I inserted the following code that you suggested in the Custom Commands” field:

    “columnDefs”: [ { “render”: function ( data, type, row, meta ) { if ( ‘display’ === type ) { data = ‘Click here‘; } return data; }, “targets”: [ 5 ] } ]

    There is something wrong with the above code. I would appreciate your help fixing this.

    • This reply was modified 4 years, 3 months ago by awjensen.
    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    the code seems to be working, but that column actually already seems to contain HTML code for links (and not just the URL). Are you maybe using the TablePress Automatic URL conversion Extension for this table? If so, please remove that Shortcode parameter again.

    Regards,
    Tobias

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Column width CSS not working’ is closed to new replies.