<li>This widget will <strong>only work</strong> in tablesorter version 2.8+ and jQuery version 1.7+.</li>
<li>The widget is still in "beta", so options & functionality may change without warning; and, it has not been thoroughly tested!</li>
<li>Make sure to include the CSS shown below to maintain the alignment.</li>
<li><spanclass="label warning">*NOTE*</span> if the table cell becomes too narrow, the alignment <strong>will not</strong> be maintained & some content may overflow into the next/previous cell (the widget css does include <code>overflow:hidden</code> on the wrapper, so some content will be hidden instead of overflowing).</li>
<li>Until the day that <code>text-align: '.';</code> becomes standard (<ahref="https://developer.mozilla.org/en-US/docs/Web/CSS/text-align">ref</a>), if ever, this widget might prove useful.</li>
</ul>
</div>
<h3><ahref="#">Options</a></h3>
<div>
<h3>Align Character (alignChar) widget default options (added inside of tablesorter <code>widgetOptions</code>)</h3>
<spanclass="label label-info">TIP!</span> Click on the link in the Option column to reveal full details (or <ahref="#"class="toggleAll">toggle</a>|<ahref="#"class="showAll">show</a>|<ahref="#"class="hideAll">hide</a> all) or double click to update the browser location.
This option allows you to wrap the alignment character in any HTML:
<divclass="collapsible">
<br>
When the widget completes the alignment, it is basically splitting the content of the table cell into two halves, and wrapping it in a span element. Below is an example of a modified cell showing all contents; it's from the "Animals" column (the cell that contains "Ox = stinky")
The <code>data-align-char</code> data-attribute contains the actual character to align. There is no default alignment character, so if this data-attribute is undefined, the column will be ignored.<br>
<br>
<spanclass="label warning">*NOTE*</span> if wanting to align the content on a space (see the "AlphaNumeric" column), use <code>&nbsp;</code> instead of a regular space because all spaces within the content are replaced by non-breaking spaces.
<td>This option points to the header data-attribute which contains the desired alignment character index (<strong>one-based index</strong>).
<divclass="collapsible">
<ul>
<li>What that means is if your data has multiple periods, like in the URLs of the sites column below, you can tell the widget which period to line-up on.</li>
<li>The alignment may seem to act incorrectly, if your data doesn't have enough periods to line up on, but it's doing the best it can! For example, in the sites column below, a table cell contains <code>"rental.nytimes.com/index.html"</code>. This URL has three periods, while all other cells in that column only contain two. When the <code>data-align-index</code> is set to <code>"3"</code>, the widget aligns the content on that third period. All of the other columns only have two, so they all align on their last period. Does that make it clear?</li>
<li>Try adjusting the sliders in this demo to change the <code>data-align-index</code> of the "Animals" and "Sites" columns to see how this works.</li>
</td></pre>As you can see, the "87" (integer-part) is in a "ts-align-left" span, set with a <code>text-align: right;</code> (it's on the left, but right aligned)<br>
The ".20000" (fractional-part) is in a "ts-align-right" span, set with a <code>text-align: left;</code> (opposite of the other one)!<br>
</li>
<li>So in the above example, the left side is set to a width of "36%" and the right to "64%" (adding up to 100%), which "sort-of" centers the aligned character.</li>
<li>If you don't want to move the position of the aligned character, you can set the <code>data-align-adjust</code> data-attribute with a percentage change. This value (positive or negative) will be added to the "ts-align-left" span, and subtracted from the "ts-align-right" span.</li>
<li>Try adjusting the sliders in this demo to change the <code>data-align-adjust</code> of the "Sites" column to see how this works.</li>
The <code>data-align-adjust</code> data-attribute contains a percentage value (without the percent sign). The adjustment defaults to "0" if this data-attribute is undefined.
</div>
</td>
</tr>
</tbody>
</table>
</div>
<h3><ahref="#">CSS</a></h3>
<div>
The following is *required* css. Without it, the alignment will be all wrong.
<divid="css">
<preclass="prettyprint lang-css"></pre>
</div>
</div>
</div>
<p></p>
<h1>Demo</h1>
<spanclass="demo-label">Animals align index:</span><divid="slider0"></div><spanclass="bright">1</span> (only indexes of 1 or 2 will work)<br>
<spanclass="demo-label">Sites align index:</span><divid="slider1"></div><spanclass="bright">1</span> (only indexes of 1 - 3 will work<br>