Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8542023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:57:50+00:00 2026-06-11T11:57:50+00:00

I’m using asp.net 4.0 with iTextSharp in it’s own class library. From properties, runtime

  • 0

I’m using asp.net 4.0 with iTextSharp in it’s own class library. From properties, runtime version v2.0.50727, version 5.3.0.0.

When I nest two tables, the inner table has an automatical margin or padding I can’t control. How do I get both tables to be 100%?

//edited

public PdfPTable GetHeaderInnerTable(Rectangle pageSize)
{
// create 2 table cell
// left cell for Report Header text
// right cell for microsoft internal only image
int columnCount = 2;


PdfPTable table = new PdfPTable(columnCount);
table.TotalWidth = 792;
//table.WidthPercentage = 100; // 80 is default - THIS IS THE ANSWER TO MAKE INNER TABLE 100%
float[] widthColumns = new float[] { 652, 140 }; //left edge of second column is where image should be
table.SetTotalWidth(widthColumns);

// Left Cell
PdfPCell leftCell = new PdfPCell();
leftCell.Border = 0;

Font font = fontHeaderSegoeUIRegular;
font.Color = BaseColor.WHITE;
Phrase phrase = new Phrase(0, this.PdfModel.CompanyName + Data.Strings_DataResource.PdfTitlePostpend, font);
leftCell.AddElement(phrase);
leftCell.PaddingLeft = 40; // where to start the report name text from the left
leftCell.PaddingTop = 30; // where to start the report name text from the bottom

// Right Cell
PdfPCell rightCell = new PdfPCell();
rightCell.Border = 0;
Image image = Image.GetInstance(this.PdfModel.ImageAssets.Get("HeaderBarRightMicrosoftInternalImageLocation"));

rightCell.FixedHeight = 90; // total height of red bar
rightCell.AddElement(image);
rightCell.Padding = 0;
rightCell.PaddingBottom = 10; // push image up off the red bar
rightCell.BorderWidthRight = 0;
rightCell.PaddingTop = 20; // push image down off the red bar

//// add cells to table
table.AddCell(leftCell);
table.AddCell(rightCell);

return table;
}

public PdfPTable GetHeader(Rectangle pageSize)
{
int columnCount = 1;

PdfPTable table = new PdfPTable(columnCount);
table.DefaultCell.VerticalAlignment = Element.ALIGN_TOP;
table.TotalWidth = pageSize.Width; //792  


PdfPCell headerLeftCell = new PdfPCell();
headerLeftCell.Colspan = 1;
float getleft = headerLeftCell.GetLeft(0);
float leading = headerLeftCell.Leading;

headerLeftCell.Padding = 0;
headerLeftCell.PaddingBottom = 0;
headerLeftCell.BorderWidthRight = 0;
headerLeftCell.PaddingTop = 0; // how far donw to print the phrase
headerLeftCell.PaddingLeft = 0; // how far in to print the phrase
headerLeftCell.FixedHeight = this.PixelsToPoints(90); // cell controls height of table
headerLeftCell.Border = 0;
headerLeftCell.Indent = 0;

Image backgroundHeaderImage = iTextSharp.text.Image.GetInstance(this.PdfModel.ImageAssets.Get("HeaderBarImageLocation"));  

// assign background Image to cell - 60 instead of 54 because it was gett squashed - probably the padding somehow            
headerLeftCell.CellEvent = new BackgroundImageCellEvent(backgroundHeaderImage, 60, 792);

headerLeftCell.AddElement(this.GetHeaderInnerTable(pageSize));

table.AddCell(headerLeftCell);

return table;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T11:57:52+00:00Added an answer on June 11, 2026 at 11:57 am

    One answer is to make innertable WidthPercentage 100, where if the value isn’t set, it defaults to 80.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am doing a simple coin flipping experiment for class that involves flipping a
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.