dougutuo9879 2018-08-10 08:59
浏览 190

TinyButStrong设置表格行中的字体颜色

Is there a way to set the font color in table rows? I'm using the PHP class of tbs and ODT documents. It would be perfect to be able setting individual colors to each row. But I don't know if it's possible.

I have a HTML table with different colors and want to convert it to an ODT document.

  • 写回答

1条回答 默认 最新

  • dpvomqeu396484 2018-08-31 00:52
    关注

    In XML for ODT documents, it is not possible to define a font color directly on a table row, a table cell, or a paragraph that contain the text in the cell. You can only apply a style to those elements.

    So the solution is to defined a named Paragraph Style for each font color you need in your table, and then changing the style of the paragraph (a text in cell is always in a paragraph) with a TBS field using parameter att. Example : [blk.my_style;att=text:p#table:style-name]

    Unfortunately there is an additional difficulty: LibreOffice will save your custom style with an internal name. The name you give to it using the software is only a displayed name (an alias). So the solution is to look in the styles.xml file for the internal name. Or you can wait for the next TBS version (3.11): it will have a feature for reading attributes in the template.

    评论

报告相同问题?

悬赏问题

  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大
  • ¥15 import arcpy出现importing _arcgisscripting 找不到相关程序