Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • lori ryan 239 posts 573 karma points
    Aug 07, 2018 @ 13:04
    lori ryan
    0

    Hi All

    Just wondering can anybody help me. I am trying to allow the editor to choose a class to apply to a table.

    Ive added the following into the tincymce.config in the custom config section

     <config key="table_class_list">
        [
        {"title": "None", "value": ""},
        {"title": "Striped", "value": "table table-striped"},
        {"title": "Border", "value": "table table-bordered"},
        {"title": "StripedBorder", "value": "table table-striped table-bordered"}
        ]
     ]
    

    However I still dont have a class option in the table properties. Any help would be fantastic. Umbraco version: 7.10.4

  • Marc Goodson 2141 posts 14324 karma points MVP 8x c-trib
    Aug 07, 2018 @ 18:54
    Marc Goodson
    103

    Hi Lori

    I have this in one of my projects

    <config key="table_default_attributes">{ "border" : "0", "class": "table"}</config>
    <config key="table_class_list">
      [
      {"title": "Responsive", "value": "table"},{"title": "None", "value": ""},{"title": "Hover", "value": "table table-hover"},{"title": "Striped", "value": "table table-striped"},{"title": "Condensed", "value": "table table-condensed"},{"title": "Bordered", "value": "table table-bordered"}
      ]
    </config>
    

    which works! (note the default attributes option too! - I always use this in case editors don't know how to set the class, but pretty much always want it to behave responsively)

    Anyway comparing what I have with what you've posted above, only think I can see at a glance is you have an extra closing square bracket ]

    is that what is causing it to not appear?

    Otherwise make sure to perform a refresh of the application inbetween changing this config (eg app pool recycle or rebuild if you are working locally) as these settings are only read when Umbraco starts up.

    regards

    Marc

  • lori ryan 239 posts 573 karma points
    Aug 08, 2018 @ 06:59
    lori ryan
    0

    Thank you so much Marc - more coffee needed. Was indeed the extra bracket - doh!!!

  • Marc Goodson 2141 posts 14324 karma points MVP 8x c-trib
    Aug 08, 2018 @ 07:13
    Marc Goodson
    2

    for me it's usually a missing comma!

    sorry that should be

    for me, it's usually a missing comma!

Please Sign in or register to post replies

Write your reply to:

Draft