Support » Plugin: TablePress » Different table header for each language with Polylang

  • Resolved aizenimr

    (@aizenimr)


    I’m building a website with many tables which contain technical information of products. The tables’ field names represents data such as size, weight, etc.

    I wish to use the same actual table for each language, where only the table’s header line (the first line of the table containing the actual titles or field names) is changed based upon the current selected language.

    The alternative is to create separate table for each product’s page, which consumes a lot of space and also doubles my work, and I wish to avoid such a case.

    I use Polylang to manage my site’s languages, and so far this is the last obstacle I have encountered.

    Is there any reasonable solution to such a scenario?

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

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    I would recommend a slightly different approach: Just add multiple rows for the header row at the top of the table (one for each language). Then, on the corresponding pages, simply hide the ones that you don’t want, with a Shortcode like

    [table id=123 hide_rows="1-2,4-7" /]
    

    (this example would show the third row of the table as the header row.)

    Regards,
    Tobias

    Thread Starter aizenimr

    (@aizenimr)

    Wow, it worked! Thanks!
    Now I encountered another (and hopefully last) problem:

    The cells data is displayed correctly on English, but a bit mixed up in Hebrew. For example: the string 3/4″ in English mode vs “3/4 in Hebrew. It is probably because one language is LTR while the latter is RTL.

    Is there a away to handle it based on the current display language?

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    this is indeed caused by the RTL mode that is used for Hebrew.

    To set a table to one fixed mode, try add this to the “Custom CSS” textarea on the “Plugin Options” screen of TablePress:

    .tablepress-id-123 {
      direction: ltr;
    }

    (with 123 being the table ID).

    Regards,
    Tobias

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Different table header for each language with Polylang’ is closed to new replies.