Hello, can you please suggest how can fix below formatting issue in table cell. in serial no ‘10’ 0 is coming just below to 1. as given below screen shot and highlighted.
below code is used to created table row and cell.
10 |
test data: 1234 Date: 2024
URL: https://localhost:50362/Operators/DraftReportData?q=dz27CeU+Gf5F4JqnQb2EGQ==&Entity=QYutfjXnfKR06C7iQduKvg==&CheckName=TestLitigation%20Check&CheckJur=4hYv*8paDAwr9IEW7gvuiQ==22
|
@RiteshK10 You can try to change cell width: CellFormat.Width | Aspose.Words for .NET
And I think there are spaces between 1 and 0. If still have a problem, please provide the code you are using and the input document.
thanks @vyacheslav.deryushev for sharing me solution.
But can you share me solution in HTML to change cell width:
As below html code are using.
10 |
test data: 1234 Date: 2024
URL: https://localhost:50362/Operators/DraftReportData?q=dz27CeU+Gf5F4JqnQb2EGQ==&Entity=QYutfjXnfKR06C7iQduKvg==&CheckName=TestLitigation%20Check&CheckJur=4hYv*8paDAwr9IEW7gvuiQ==22
|
@RiteshK10 Thanks for sharing additional information. Now I see html code. You try to insert this html code to the document, is it right?
@RiteshK10 Your html code is correct. The problem is the long url. The table is trying to compensate for the width between cells to display the content inside. In this case, the only way is to use the following code:
Table table = (Table)doc.GetChild(NodeType.Table, 0, true);
table.AutoFit(AutoFitBehavior.FixedColumnWidths);
table.PreferredWidth = PreferredWidth.FromPercent(100);
and then change the width of the cell.
Hello @vyacheslav.deryushev hope you are doing well and thanks for clarification.
Can you please suggest to change cell merging left and right with ‘0.1’ cm. as shared below screen shot.
how can use cell property with below code.
Table table = (Table)doc.GetChild(NodeType.Table, 0, true);
@RiteshK10 You can use:
Table table = (Table)doc.GetChild(NodeType.Table, 0, true);
foreach (Row row in table.Rows)
{
foreach (Cell cell in row.Cells)
{
var left = ConvertUtil.MillimeterToPoint(1);
var right = ConvertUtil.MillimeterToPoint(1);
cell.CellFormat.LeftPadding = left;
cell.CellFormat.RightPadding = right;
}
}
The following link can be usefull:
thanks @vyacheslav.deryushev for sharing solution.
1 Like