Text-align class for inside a table

Bootstrap 3 v3 Text Alignment Docs <p class=”text-left”>Left aligned text.</p> <p class=”text-center”>Center aligned text.</p> <p class=”text-right”>Right aligned text.</p> <p class=”text-justify”>Justified text.</p> <p class=”text-nowrap”>No wrap text.</p> Bootstrap 4 v4 Text Alignment Docs <p class=”text-xs-left”>Left aligned text on all viewport sizes.</p> <p class=”text-xs-center”>Center aligned text on all viewport sizes.</p> <p class=”text-xs-right”>Right aligned text on all viewport sizes.</p> … Read more

Align printf output in Java

You can try the below example. Do use ‘-‘ before the width to ensure left indentation. By default they will be right indented; which may not suit your purpose. System.out.printf(“%2d. %-20s $%.2f%n”, i + 1, BOOK_TYPE[i], COST[i]); Format String Syntax: http://docs.oracle.com/javase/7/docs/api/java/util/Formatter.html#syntax Formatting Numeric Print Output: https://docs.oracle.com/javase/tutorial/java/data/numberformat.html PS: This could go as a comment to DwB’s … Read more

“text-align: justify;” inline-block elements properly?

Updated the “Future” solution info below; still not yet fully supported. Present Workaround (IE8+, FF, Chrome Tested) See this fiddle. Relevant CSS .prevNext { text-align: justify; } .prevNext a { display: inline-block; position: relative; top: 1.2em; /* your line-height */ } .prevNext:before{ content: ”; display: block; width: 100%; margin-bottom: -1.2em; /* your line-height */ } … Read more

Justify the last line of a div?

Here’s a cross-browser method that works in IE6+ It combines text-align-last: justify; which is supported by IE and a variation of the :after pseudo-content method. It includes a fix to remove extra space added after one line text elements. CSS: p, h1{ text-align: justify; text-align-last: justify; } p:after, h1:after{ content: “”; display: inline-block; width: 100%; … Read more