Simple CSS:
table.tgi
{
width:100%;
}
table.tgi td.labelcell
{
text-align:right;
color:Red;
}
table.tgi td.valuecell
{
text-align:left;
color:Green;
}
Simple HTML:
<table id="tgi" runat="server" width="100%">
<tbody>
<tr>
<td class="labelcell">ID:</td>
<td></td>
<td class="labelcell">Originator:
</td>
<td class="valuecell"><asp:Button ID="Button1" runat="server" Text="Button" /></td>
</tr>
<tr>
<td class="labelcell">Expected Ship Date:</td>
<td class="valuecell"><asp:TextBox ID="txtExpectedShipDate" runat="server"></asp:TextBox></td>
<td class="labelcell">Actual Ship Date:</td>
<td class="valuecell"><asp:TextBox ID="txtActualShipDate" runat="server"></asp:TextBox></td>
</tr>
</tbody>
</table>
But the TD styling does not work…
Edit
I tried this:
table#tgi
{
width:100%;
}
table#tgi td.labelcell
{
text-align:right;
color:Red;
}
table#tgi td.valuecell
{
text-align:left;
color:Green;
}
With HTML:
<table id="tgi" runat="server">
<tbody>
<tr>
<td class="labelcell">ID:</td>
<td class="valuecell"></td>
<td class="labelcell">Originator:</td>
<td class="valuecell"><asp:Button ID="Button1" runat="server" Text="Button" /></td>
</tr>
<tr>
<td class="labelcell">Expected Ship Date:</td>
<td class="valuecell"><asp:TextBox ID="txtExpectedShipDate" runat="server"></asp:TextBox></td>
<td class="labelcell">Actual Ship Date:</td>
<td class="valuecell"><asp:TextBox ID="txtActualShipDate" runat="server"></asp:TextBox></td>
</tr>
</tbody>
</table>
This doesnt work…
but if I change it to a class it works…but I want to try it with an ID???
Your table has an ID if tgi, not a class.
Fix #1
Fix #2