[Zope] Need some newbie tal help

Mark Phillips mark at phillipsmarketing.biz
Tue Oct 5 13:45:43 EDT 2010


On Tue, Oct 5, 2010 at 10:42 AM, Andrew Milton <akm at theinternet.com.au>wrote:

> +-------[ Mark Phillips ]----------------------
> |
> |
> | On Tue, Oct 5, 2010 at 10:28 AM, Andrew Milton <akm at theinternet.com.au>
> wrote:
> |
> |     +-------[ Mark Phillips ]----------------------
> |     | I have a table and I am putting data into the cells using tal. I
> want to bold the data under a certain condition. I tried
> |     this,
> |     | but it didn't work:
> |     |
> |     | <td tal:content="string:${player/name}"><b
> tal:condition="python:str(player['name']) == 'Team'">name</b></td>
> |
> |     Try using css
> |
> |     <td><div tal:replace="string:${player/name}" tal:attributes="class
> python:test(player['name'] == 'Team', 'someboldcss', '')"
> |     /></td>
> |
> |
> | Is CSS preferred over using tal:omit for some reason? When would I use
> tal:omit to add formatting to a table cell and when should
> | I use CSS instead?
>
> I think you want to use CSS. Later if you want to change from bold to
> underlined or italics or rainbow, you can just change a CSS class,
> instead of rebuilding your mark up.
>
> Thanks! good advice!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope/attachments/20101005/71630d9b/attachment.html 


More information about the Zope mailing list