• Resolved Maria_Justesen

    (@maria_justesen)


    Hi

    I am having trouble with my CSS in Tablepress.

    My table has 3 columns. HOWEVER I want some of the rows to have 100% width because I only have info in the first out of the 3 columns. This is long text, and I do not want it to be placed over multiple lines, when it can be done with one.
    Tablepress will not allow me to do this. When I use the code:

    .tablepress-id-45 .column-1 {
    width: 100%;
    }

    it works – HOWEVER then the rows below get pushed. I then added

    .tablepress-id-45 th,
    .tablepress-id-45 td {
    width: 33%;
    }

    That did nothing until I removed the first code. I have also tried with the code:

    .tablepress-id-45 .row-1 {
    width: 100%;
    }
    where I write row instead of column – since it is the row and not the column, that I want to change. But nothing happens.

    I have also tried to merge the cells. However, then I cannot use the DataTables JavaScript library, which I need, because the table is long, and it needs to be split up by using pagination.

    So I am at a loss. The page is this: http://www.azitech.dk/events/hands-on-hdi-workshop/

    You can see the problem under WORKSHOP OVERVIEW
    I want the first line to be full width: During these two days, you will be exposed to a minimum of the following PCB Designer methodologies:

    And the next rows to be 3 equal column spans. (All the grey should be with 100% width and the rest 3 equally spanned columns.)

    How can I do this?? Please help 🙂

    https://wordpress.org/plugins/tablepress/

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

    (@tobiasbg)

    Hi,

    thanks for your question, and sorry for the trouble.

    Unfortunately, this will not work like this, due to how HTML tables work.
    You can not have one cell of a column span the entire table, when the same column is other rows is smaller. The cells of a column always have to have the same width.
    The only way around this would be merging cells, but as you have already found out, it is not possible to use the DataTables JS library then 🙁

    Unfortuantely, your link is only giving a 404 Not found error for me, so I can not check for possible other suggestions. Is this really a published page?

    Regards,
    Tobias

    Thread Starter Maria_Justesen

    (@maria_justesen)

    Hi

    The page is now publish. Sorry 🙂

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    thanks for that!

    Yeah, the only approach to make this work in this table is indeed to merge the cells with the “colspan” button.
    Unfortunately, you will then not be able to use the Pagination feature, as the DataTables JS library that TablePress uses simply does not support tables with merged cells 🙁
    As I’m not the developer of that library, there’s nothing that I can do about this, I’m afraid.

    Regards,
    Tobias

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

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