Support » Plugin: TablePress » a lot of tables

  • Resolved marmitako

    (@marmitako)


    Hallo,
    I have created a lot of tables for my web and at now i change format one to one, but the CSS code its the same for all tables.
    It’s posible or there is one way to change the format all tables at same time in one function?
    I have no idea of CSS. At now i copy and paste lines of code
    Thanks Tobias, good job

    Héctor

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for your question, and sorry for the trouble.

    Yes, you can write CSS code that applies to all tables at once, just use the
    .tablepress ... {
    CSS selector instead of
    .tablepress-id-123 ... {
    For more information, please also see https://tablepress.org/faq/documentation-css-selectors-styling/

    Regards,
    Tobias

    I get your response and read another that you sent to another user.
    Actually, in the plugin options section I have this code for several tables:

    .tablepress-id-12 thead th {
    text-align: center;
    vertical-align: middle;
    }
    .tablepress-id-12 tbody td { padding-top: 1px;
    padding-bottom: 1px;
    }
    .tablepress-id-12 tbody td.column-1 {
    text-align: left;
    }
    .tablepress-id-12 tbody td.column-2 {
    text-align: center;
    }
    .tablepress-id-12 tbody td.column-3 {
    text-align: center;
    }
    .tablepress-id-12 tbody td.column-4 {
    text-align: center;
    }
    .tablepress-id-12 tbody td.column-5 {
    text-align: right;
    }
    .tablepress-id-12 tbody td.column-6 {
    text-align: right;
    }
    .tablepress-id-12 .row-1 {
    background-color: #8DCBEC;
    }
    .tablepress-id-13 thead th {
    text-align: center;
    vertical-align: middle;
    }
    .tablepress-id-13 tbody td {
    padding-top: 1px;
    padding-bottom: 1px;
    }
    .tablepress-id-13 tbody td.column-1 {
    text-align: left;
    }
    .tablepress-id-13 tbody td.column-2 {
    text-align: center;
    }
    .tablepress-id-13 tbody td.column-3 {
    text-align: center;
    }
    .tablepress-id-13 tbody td.column-4 {
    text-align: center;
    }
    .tablepress-id-13 tbody td.column-5 {
    text-align: right;
    }
    .tablepress-id-13 tbody td.column-6 {
    text-align: right;
    }
    .tablepress-id-13 .row-1 {
    background-color: #8DCBEC;
    }

    I understand in code you send me…
    If i write this code:

    .tablepress thead th,
    .tablepress tbody td {
    text-align: center;
    vertical-align: middle;
    padding-top: 1px;
    padding-bottom: 1px;
    td.column-1 text-align: left;
    td.column-2 text-align: center;
    td.column-3 text-align: center;
    td.column-4 text-align: center;
    td.column-5 text-align: center;
    }
    all tables i have change the format?
    From id=1 to id=n ?

    Thanks and i am sorry for this long code, amb for my poor english

    Sorry, in teh same topic.
    My tables are in diferents post. One post, one table
    Sorry.

    Hector

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    your rewritten code comes very close to the correct one, it was just a bit too much simplification:

    .tablepress thead th,
    .tablepress tbody td {
      text-align: center;
      vertical-align: middle;
      padding-top: 1px;
      padding-bottom: 1px;
    }
    
    .tablepress .column-1 {
      text-align: left;
    }
    .tablepress .column-6 {
      text-align: right;
    }

    Regards,
    Tobias

    Hi, Tobias
    I already understood your code.
    What is involved, when talking about the total tables of the site, is not to indicate the ID.
    I already told you that I have no idea of CSS.
    Thank you so much. It works perfectly.
    Regards,
    Héctor
    (I have rated jet your plugin)

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    correct, when you want to influene all tables at once, just leave out the -id-123 part of the CSS selector.

    Regards,
    Tobias

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘a lot of tables’ is closed to new replies.