Here’s my current code,
$(document).ready(function () {
$(".stripeMe tr").mouseover(function () {
$(this).addClass("over");
}).mouseout(function () {
$(this).removeClass("over");
});
$(".stripeMe tr:even").addClass("alt");
});
<table class="stripeMe" width="100%">
<tr>
<td style="width:85%">Product Name</td>
<td style="width:5%; text-align:right">Price (each)</td>
<td style="width:5%; text-align:center">Quantity</td>
<td style="width:5%"></td>
</tr>
<% foreach (var cart in Model.Carts) { %>
<tr id="row-<%: cart.RecordID %>">
<td>
<%: Html.ActionLink(Model.pr.GetProduct(cart.ProductID).ProductName.Length > 52 ? (string)Model.pr.GetProduct(cart.ProductID).ProductName.Substring(0, 52) + "..." : (string)Model.pr.GetProduct(cart.ProductID).ProductName, "Elaborate", "Product", new { ProductID = cart.ProductID, RecordID = cart.RecordID }, null)%>
</td>
<td style="text-align:right">
<%: (string)String.Format("{0:F}",Model.pr.GetProduct(cart.ProductID).UnitPrice) %>
</td>
<td>
<input type="text" disabled="disabled" style="text-align:center; border-width:0; background-color:transparent" id="column-Quantity-<%: cart.RecordID %>" value="<%: cart.Quantity %>"></input>
</td>
<td>
<%: Ajax.ActionLink("Remove from Cart", "RemoveFromCart", new { RecordID = cart.RecordID }, new AjaxOptions {OnSuccess = "handleUpdate" })%>
</td>
</tr>
<% } %>
<tr>
<td><hr />Total</td>
<td align="right">
<hr />
<span id="cart-total"><%: (string)String.Format("{0:F}",Model.CartTotal) %></span>
</td>
<td align="center">
<hr />
<span id="cart-quantity"><%: Model.CartQuantity %></span>
</td>
<td><hr /> </td>
</tr>
</table>
No matter how I change it, it doesn’t work. I’m using the latest version of Firefox.
<td style="width:85%">Product Name</td>
First I would like say “THANK YOU” to everybody who put effort to help me out, especially thanks to “rae1n”, “Deminoth Bono”, “tristan” and “OMG” !!! all you guys effort help me figure out the issue and solve it.
First I use firefox “error console”, I find a javascript issue which is sit there long time, then I fix it, but unfortunately our “Width” issue still there.
Second from “rae1n” and “OMG” post, I start to thought this may not an ” width” issue, so I start to look around, after one day thinking……, finally I figure out the issue is at input type=”text” tag. You know, if you do not give a width in the input type=”text”, it will render an textbox with fix width looks like 200px, this cause the issue. So what ever how I change the “td” percentage, it still keep same looking. So I add style=”width:100%” into the input type=”text”… , then change the “td” width, the “td” width show correct changing. the issue get fixed. Below code is how I correct it.