I have created a html table with 2 columns. I want the first column containing text to be right aligned, but i want the second column to stay left aligned as it contains check boxes. For presentation it would look, but ive no idea. I have tried creating a td class="column1" then text-align: right; in the CSS but no luck.
Any ideas would be greatly appreciated.
HTML
<td class="column1">Retrieve Logs:</td>
<td class="column2"><input type=checkbox name="getcamlogs" checked="checked"></td>
CSS
td.column1 {
text-align: right;
}
Applying separate right and left alignment to the same line of text is impossible in Word; the format goes with the entire line. Usually, when you need that kind of arrangement, you might insert a table with two or more cells and apply the alignments to the cells.
Go to the Layout tab and you will find there's an Alignment toolbox there. The Alignment toolbox has nine buttons for aligning text in a table in Microsoft Word. From left to right, and top to bottom, the buttons let you align text to the right, and top, center and top, and left and top.
To allow text to flow around the table, use ALIGN=LEFT to position the table at the left margin, with text flowing around its right handside, or use ALIGN=RIGHT to position the table at the right margin, with text flowing around its left handside.
Here you go, this should work :)
<style>
#mytable {width:500px; margin:0 auto;}
#mytable td {width:250px;}
#mytable .left {text-align:right; background:#333;}
#mytable .right {text-align:left; background:#666;}
</style>
<table id="mytable">
<tr>
<td class="left">1</td>
<td class="right">2</td>
</tr>
</table>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With