[TYPO3] Problem styling tables (contenttable)

JoH asenau info at cybercraft.de
Tue May 8 15:15:08 CEST 2007


> I am thinking that the class "contenttable" can be configured through
> "CSS Styled Content". The file pi1/class.tx_cssstyledcontent_pi1.php
> holds the following code:
>
> -----------------------------------------
> // Table tag params.
> $tableTagParams = $this->getTableAttributes($conf,$type);
> if (!$noStyles) {
> $tableTagParams['class'] = 'contenttable
> contenttable-'.$type.($tableClass?' '.$tableClass:'');
> } elseif ($tableClass) {
> $tableTagParams['class'] = $tableClass;
> }
> -----------------------------------------

This has nothing to do with your problem, since it is just the PHP code used
to render the content element type "table" but not the tables of any RTE.

> But to be honest I got no clue how to edit it, or maybe I am just
> completely of track. Am I?

Yes ;-)

> All suggestions on how to solve this problem are most welcome.

Go to the TSOB (TypoScript Objectbrowser) and foldout the section

lib.parseFunc_RTE

inside you will find some other foldouts:

externalBlocks => table => stdWrap => HTMLparser => tags => table

and this is the place you have been looking for.

In human readable language it means: Treat <table> tags as external blocks,
that have to be parsed separately and define how the tag <table> of these
blocks should be processed.

In this case there is something like

fixAttrib {
    class {
        default = contenttable
        always = 1
        list = contenttable
    }
}

This means that the class attribute of table tags has to be checked for the
class name.
If there is no class attribute at all (always) or just no class name
(default), the class name should be "contenttable".
If there is a class name it must be in the comma separated list (list), else
the first element of the list is taken.

For you this means: It should be enough to add your class name to the comma
separated list to prevent the parser from changing it to "contenttable".

All in one line it should be:
lib.parseFunc_RTE.externalBlocks.table.stdWrap.HTMLparser.tags.table.fixAttr
ib.class.list = yourname

HTH

Joey

-- 
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your gob sometimes!)
Dieter Nuhr, German comedian
openBC/Xing: http://www.cybercraft.de
T3 cookbook: http://www.typo3experts.com




More information about the TYPO3-english mailing list