Xml RazorPDF-如何设置单元格、段落等标签的背景色

Xml RazorPDF-如何设置单元格、段落等标签的背景色,xml,asp.net-mvc,itextsharp,background-color,razorpdf,Xml,Asp.net Mvc,Itextsharp,Background Color,Razorpdf,我只是想用RazorPDF创建一个简单的xml布局,但是我找不到任何方法来设置一些标记的背景色 这就是我试过的 <paragraph style="background-color:red"> <chunk bgcolor="red">sampletext</chunk> </paragraph> @视图包。标题 如果使用表格,backgroundcolor=“#808080”属性设置背景色,而style=“color:blue”或red

我只是想用RazorPDF创建一个简单的xml布局,但是我找不到任何方法来设置一些标记的背景色

这就是我试过的

<paragraph style="background-color:red">
   <chunk bgcolor="red">sampletext</chunk>
</paragraph>

@视图包。标题

如果使用表格,backgroundcolor=“#808080”属性设置背景色,而style=“color:blue”或red=“0”green=“0”blue=“255”设置文本颜色

<table width="100%" cellpadding="1.0" cellspacing="1.0">
<row>
    <cell backgroundcolor="#FFFF00" borderwidth="0.5" left="true" right="true" top="true" bottom="true" size="12.0">
        <chunk style="font-family:Times;font-weight:bold;font-size:9pt">
            Customer
        </chunk>
    </cell>
    <cell backgroundcolor="#FFFF00" borderwidth="0.5" left="true" right="true" top="true" bottom="true" size="12.0">
        <chunk style="font-family:Times;font-weight:bold;font-size:9pt;color:blue">
            Customer
        </chunk>
    </cell>
    <cell backgroundcolor="#FFFF00" borderwidth="0.5" left="true" right="true" top="true" bottom="true" size="12.0">
        <chunk red="0" green="0" blue="255" style="font-family:Times;font-weight:bold;font-size:9pt">
            Customer
        </chunk>
    </cell>
</row></table>

顾客
顾客
顾客

这只会更改字体颜色,而不会更改背景颜色。请检查您的答案后再张贴在这里。
    <paragraph  style="font-family:Helvetica;font-size:14; border:1px" align="center">
        <chunk red="0" green="0" blue="255" >@ViewBag.Title</chunk>
    </paragraph>
<table width="100%" cellpadding="1.0" cellspacing="1.0">
<row>
    <cell backgroundcolor="#FFFF00" borderwidth="0.5" left="true" right="true" top="true" bottom="true" size="12.0">
        <chunk style="font-family:Times;font-weight:bold;font-size:9pt">
            Customer
        </chunk>
    </cell>
    <cell backgroundcolor="#FFFF00" borderwidth="0.5" left="true" right="true" top="true" bottom="true" size="12.0">
        <chunk style="font-family:Times;font-weight:bold;font-size:9pt;color:blue">
            Customer
        </chunk>
    </cell>
    <cell backgroundcolor="#FFFF00" borderwidth="0.5" left="true" right="true" top="true" bottom="true" size="12.0">
        <chunk red="0" green="0" blue="255" style="font-family:Times;font-weight:bold;font-size:9pt">
            Customer
        </chunk>
    </cell>
</row></table>