title: How to line up variable-length underscore lines on web page?
body: <p>I am using TCPDF to display some table data.  For that, I use HTML + CSS, which is then converted to PDF form.  I want to have underline lines in my table, where people can write-in notes.  I currently use the underline character <code>_</code> to draw these lines.  The problem I seem to have is that they are jagged on the right hand side (see exaggerated image below). 
  <img src="https://i.stack.imgur.com/Bci3a.png" alt="enter image description here"></p>
  
  <p>I am looking for a way to not have the lines be jagged.  In reality I can make them less jagged but due to non-fixed-width fonts, they still appear a little jagged, even if I add/remove the underline characters to try to line them up.</p>
  
  <p>I am looking for any reasonable solution where underlines line up to the right border of table/div/container.  This can be done any way (using chars or CSS, or maybe even images), as long as things line up properly.  In my case the container is <code>&lt;td&gt;words words _____&lt;/td&gt;</code></p>
  
  <p>Something like this:
  <img src="https://i.stack.imgur.com/i2aoj.png" alt="enter image description here"></p>
  
  <p><strong>Note / Update :</strong></p>
  
  <p>Unfortunately, after trying answers below I found out that TCPDF is not very robust or forgiving when it comes CSS markup that is a little more than basic.  The solutions below while work on browsers, did not seem to survive the HTML+CSS to {PDF through TCPDF} converter.  I am not sure if a solution is possible given the state of TCPDF development, at least for the free version. I may have to stick with uneven underline chars for now.</p>