We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Background colour does not fill the table cell when the table padding is 4 and the border width is changed

Dear Aspose,

This issue is a more detailed expansion of an issue reported by my colleague here.

I have found when the table padding is set to “4” and the border width is changed. The table cell background does not fill the whole cell, it leaves one line of pixels at the bottom white.

This only occurs when the user uses the document model to build a table.
(Aspose.Words.Tables.Cell.CellFormat.Borders.LineWidth= 1;)

If I were to just “inserthtml()” this will produce the document correctly.
It seems to be a difference in implementation between the two methods that causes this issue.

I have tried your suggestion of an Aspose Upgrade, but 11.0 still shows the issue.

This issue occurs in word (2003 and 2007) but only at even zoom levels (100%, 120%), and does not appear on physical printed output. Pdf is fine.
The best workaround I could suggest to my users is to not specify a cell border width or to change the padding size.

Attached code, and output.

Thanks in advance


public void Test()
/// First table is built using the insert HTML method. ///

Aspose.Words.DocumentBuilder documentBuild = new Aspose.Words.DocumentBuilder();

/// Second table is built using the document model ///
var AsposeSection = documentBuild.Document.Sections[0];

var AsposeTable = new Aspose.Words.Tables.Table(documentBuild.Document);
Aspose.Words.Tables.Row row = new Aspose.Words.Tables.Row(documentBuild.Document);
Aspose.Words.Tables.Cell cell = new Aspose.Words.Tables.Cell(documentBuild.Document);


AsposeTable.RightPadding = AsposeTable.BottomPadding = AsposeTable.TopPadding = AsposeTable.LeftPadding = 4;

/// If I change any of these properties there is a bug in the background color height ///

// AsposeTable.SetBorders(Aspose.Words.LineStyle.Single, 1, Color.Black);
cell.CellFormat.Borders.LineWidth = 1;

// Not affected by changed values
cell.CellFormat.Borders.LineStyle = Aspose.Words.LineStyle.Single;
cell.CellFormat.Borders.Color = Color.Black;

// This is needed to figure out if the there is a space between the border and the background
cell.CellFormat.Shading.BackgroundPatternColor = Color.Firebrick;

string methodName = new StackTrace().GetFrame(0).GetMethod().Name;

documentBuild.Document.Save(methodName + " - Pre Aspose Refactor.doc", Aspose.Words.SaveFormat.Doc);
documentBuild.Document.Save(methodName + " - Pre Aspose Refactor.docx", Aspose.Words.SaveFormat.Docx);
documentBuild.Document.Save(methodName + " - Pre Aspose Refactor.pdf", Aspose.Words.SaveFormat.Pdf);

private static string GetBackPageTable()
return @"<Table border=1 width="“100%”" cellspacing="“0"” align=Left cellpadding=4>
<tr bgcolor=Silver height= ““200"”>
<td width=”“50%”" bgcolor=Silver>Questionnaire / Ability Test

Comparison Group

<td width="“50%”"><InstrumentName[/2,36,900]>

<Table border=1 width="“100%”" align=Left cellspacing="“0"” cellpadding=4>

<td width="“20%”" bgcolor=Silver>Name
<span style="“font-size: 9pt;”"> 

<td width="“20%”" bgcolor=Silver>Candidate Data
<span style="“font-size: 9pt;”">RP1=<ScaleValue/OPQ32_RP1.sten>,
RP2=<ScaleValue/OPQ32_RP2.sten>, RP3=<ScaleValue/OPQ32_RP3.sten>,
RP4=<ScaleValue/OPQ32_RP4.sten>, RP5=<ScaleValue/OPQ32_RP5.sten>,
RP6=<ScaleValue/OPQ32_RP6.sten>, RP7=<ScaleValue/OPQ32_RP7.sten>,
RP8=<ScaleValue/OPQ32_RP8.sten>, RP9=<ScaleValue/OPQ32_RP9.sten>,
RP10=<ScaleValue/OPQ32_RP10.sten>, TS1=<ScaleValue/OPQ32_TS1.sten>,
TS2=<ScaleValue/OPQ32_TS2.sten>, TS3=<ScaleValue/OPQ32_TS3.sten>,
TS4=<ScaleValue/OPQ32_TS4.sten>, TS5=<ScaleValue/OPQ32_TS5.sten>,
TS6=<ScaleValue/OPQ32_TS6.sten>, TS7=<ScaleValue/OPQ32_TS7.sten>,
TS8=<ScaleValue/OPQ32_TS8.sten>, TS9=<ScaleValue/OPQ32_TS9.sten>,
TS10=<ScaleValue/OPQ32_TS10.sten>, TS11=<ScaleValue/OPQ32_TS11.sten>, TS12=<ScaleValue/OPQ32_TS12.sten>, FE1=<ScaleValue/OPQ32_FE1.sten>,
FE2=<ScaleValue/OPQ32_FE2.sten>, FE3=<ScaleValue/OPQ32_FE3.sten>,
FE4=<ScaleValue/OPQ32_FE4.sten>, FE5=<ScaleValue/OPQ32_FE5.sten>,
FE6=<ScaleValue/OPQ32_FE6.sten>, FE7=<ScaleValue/OPQ32_FE7.sten>,
FE8=<ScaleValue/OPQ32_FE8.sten>, FE9=<ScaleValue/OPQ32_FE9.sten>,
FE10=<ScaleValue/OPQ32_FE10.sten>, CNS=<ScaleValue/OPQ32_CNS.sten>.

<td width="“20%”" bgcolor=Silver>Report
<span style="“font-size: 9pt;”">OPQ32 Profile v2.0

Hi Dominic,

Thanks you for inquiry.

>> I have found when the table padding is set to "4" and the border width is changed. The table cell background does not fill the whole cell, it leaves one line of pixels at the bottom white.

Using latest Aspose.Words 11.0.0, i managed to reproduce the problem on my side. I have logged this issue in our bug tracking system. Your request has been linked to the appropriate issue. You will be notified as soon as it is fixed.

In case of any further query, please let me know.

Dear Aspose,

I also find the same issue if the border is set to 2 (which is automatically modified to 2.25) and the padding is set to 0.

Kind Regards,


Hi Gavin,

Thanks for your inquiry and sharing additional information.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

I have verified the status of this issue (WORDSNET-5819) from our issue tracking system and regret to share that this issue is still unresolved. Currently it is pending for analysis and is in the queue. Also, at the moment I can't provide you the ETA for this issue. However, we will inform you via this forum thread as soon as it's resolved.

Sorry for the inconvenience faced.

Best Regards,

Hi Aspose Team,

Could you please provide update on the issue WORDSNET-5819.



Hi Jitender,

Thanks for your patience.

I am afraid this issue WORDSNET-5819 has now been postponed till a later date due to some other important issues and new features. We will inform you as soon as there are any further developments.

We apologize for your inconvenience.