title: PdfPCell NoWrap=true overflows width of the PdfPTable
body: <p>When I set a PdfPCell's property <code>NoWrap = true</code>, if the text inside the cell is wider than the table, it overflows the width of the table. I have a 36f margin, and I set the <code>table.WidthPercentage = 100f</code>, and that is working fine. But if I put a long string of text in a cell with <code>NoWrap = true</code>, it goes all the way to the very edges of the document. Is there any way to keep the text in the cell from going outside the width of the table?</p>
  
  <p>Here is my code:</p>
  
  <pre><code>customFont = FontFactory.GetFont(defaultFontName, 22, Font.BOLD);
  string vehicleName = vehicle.Name;
  Phrase vName = new Phrase(vehicleName, customFont);
  vName.Leading = 22f;
  table = new PdfPTable(1);
  table.SpacingAfter = 10f;
  table.WidthPercentage = 100f;
  cell = new PdfPCell(vName);
  cell.Border = 1;
  cell.HorizontalAlignment = 1;
  cell.NoWrap = true;
  cell.Padding = 0;
  table.AddCell(cell);
  document.Add(table);
  </code></pre>
  
  <p>And when this displays on the document, it looks like this:</p>
  
  <p><img src="https://i.stack.imgur.com/QYlSr.jpg" alt="enter image description here"></p>
  
  <p>As you can see, the text is overflowing the border of the cell. I guess I just assumed that if the cell was NoWrap, it would fill up the cell, then stop when it couldn't show any more. Maybe that's not possible.</p>
  
  <p>Or any other ideas on how to make a one-line title that can never wrap to more lines?</p>