Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spacing between characters inside of HTML <td> tag - why does it become stretched out?

I am working with an HTML table that is misbehaving when it comes to semi-long lengths of text. The picture below is worth 1000 words. In the first cell shown, the text "Embroidered Lettering Only" becomes stretched out as far as 'between character spacing' goes. It looks like its happening on the next cell as well in the "FLOSS" text.

Is there an attribute that I can use to prevent this behavior? Most of my search results have mostly produced table spacing issues, not text inside of a cell. The only attribute on the table that relates to size is <table width="100%"> I would prefer to conquer this with an inline attribute, but I can work with almost anything.

Note that I have tried letter-spacing= "0" and other values, to no avail. It is modifying the spacing behavior, but a value of 0 does not change this to normal spacing in the screenshot example.

I don't think it matters, but this is HTML that is being converted to a PDF through the BFO engine, within a NetSuite environment

table with inconsistent character spacing

like image 484
dah97765 Avatar asked Feb 08 '23 07:02

dah97765


1 Answers

I've come across this issue using Netsuite / BFO, the solution is to use this CSS:

td p {
    text-align: left;
}

Source (login required): https://usergroup.netsuite.com/users/forum/platform-areas/customization/bfo/397738-how-do-i-prevent-text-justification-advanced-pdf-freemarker-bfo

like image 60
michoel Avatar answered Feb 11 '23 06:02

michoel