Add Bootstrap class-names to Typo3 tables

前端 未结 2 1122
清歌不尽
清歌不尽 2021-01-19 06:26

Is there a possibility to add Bootstrap table-classes to tables created in Typo3 v6.1? I have noticed the setting \"Additional CSS Class\" when creating a page of type \"Tab

2条回答
  •  心在旅途
    2021-01-19 07:07

    From your post, I assume that you are using the content element table, not a table in the RTE.

    Overriding the classes of the RTE would be easy (in TypoScript setup):

    lib.parseFunc_RTE {
        externalBlocks {
            table.stdWrap.HTMLparser.tags.table.fixAttrib.class {
                default = table table-hover
                always = 1
                list >
            }
        }
    }
    

    (The TYPO3 default is "contenttable".)

    Overriding the classes of the table CE is harder. Only the FlexForm value is respected, if it is not set, it falls back to the standard classes, see https://git.typo3.org/Packages/TYPO3.CMS.git/blob/HEAD:/typo3/sysext/css_styled_content/Classes/Controller/CssStyledContentController.php#l130

    You will find two solutions in How to generate

    compatible with jQueryMobile in TYPO3. The first one seems the best to me, the second one looks very hacky.

    提交回复
    热议问题