<pre><code>&lt;td title="this is a really long line that I'm going to truncate"&gt;this is a really long line that I'm going to trunc ...&lt;/td&gt;
</code></pre>

<p>Is this the correct way to do it?</p>

Yes, that's how you supposed to assign tooltips to html elements. I wouldn't use it on <td> though. Although I haven't tested it, I have the feeling that you might run into issues on some browsers if you use it on table rows/cells directly since these elements have somewhat different behaviour from other elements. You should rather  use it on more "regular" elements, for example <div>, <span>, <img>  or <input>.