Default-cell-style-name in table rows

Hi all,

I’m trying to programmatically create some .ods files, and can’t seem to get row formatting right. I have an automatic style called “bold”:

<office:automatic-styles>
    <style:style style:family="table-cell" style:name="bold" style:display-name="bold">
      <style:text-properties fo:font-weight="bold" />
      <style:table-cell-properties fo:background-color="#FFFF87" />
    </style:style>
    ...

and then try the following:

<table:table-row table:default-cell-style-name="bold">
  <table:table-cell office:value-type="string">
    <text:p>foo</text:p>
  </table:table-cell>
  <table:table-cell office:value-type="string">
    <text:p>bar</text:p>
  </table:table-cell>
</table:table-row>

but the cells are not formatted at all.

If I add a table column and put the default-cell-style-name attribute in there:

<table:table-column table:default-cell-style-name="bold" table:number-columns-repeated="2" />
<table:table-row>
  <table:table-cell office:value-type="string">
    <text:p>foo</text:p>
  </table:table-cell>
  <table:table-cell office:value-type="string">
    <text:p>bar</text:p>
  </table:table-cell>
</table:table-row>

then the two cells are displayed in the desired style.

Is this a quirk of LibreOffice, or am I misunderstanding the specification?

Thanks and best regards

You must have misread something in the specification or looked at the wrong place. Read it again. It is really clear about what elements can have default cell style name.

Edit: Oh, sorry, I first read your example just plain wrong, so I was convinced the attribute belongs to <table> element. But it definitely does not. This must be LO’s bug then. Please write a bug report.

Thanks mahfiaz, I’ll do that.

The comment function is removing my formatting, so here’s the spec linked to in mahfiaz’ answer:

The table:default-cell-style-name attribute is usable with the following elements: table:table-column 9.1.6 and <table:table-row> 9.1.3.

So I still don’t get why it only works on columns and not on rows.