Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to change HTML table td width?
    primarykey
    data
    text
    <p>Here's my current code,</p> <pre><code>$(document).ready(function () { $(".stripeMe tr").mouseover(function () { $(this).addClass("over"); }).mouseout(function () { $(this).removeClass("over"); }); $(".stripeMe tr:even").addClass("alt"); }); &lt;table class="stripeMe" width="100%"&gt; &lt;tr&gt; &lt;td style="width:85%"&gt;Product Name&lt;/td&gt; &lt;td style="width:5%; text-align:right"&gt;Price (each)&lt;/td&gt; &lt;td style="width:5%; text-align:center"&gt;Quantity&lt;/td&gt; &lt;td style="width:5%"&gt;&lt;/td&gt; &lt;/tr&gt; &lt;% foreach (var cart in Model.Carts) { %&gt; &lt;tr id="row-&lt;%: cart.RecordID %&gt;"&gt; &lt;td&gt; &lt;%: Html.ActionLink(Model.pr.GetProduct(cart.ProductID).ProductName.Length &gt; 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)%&gt; &lt;/td&gt; &lt;td style="text-align:right"&gt; &lt;%: (string)String.Format("{0:F}",Model.pr.GetProduct(cart.ProductID).UnitPrice) %&gt; &lt;/td&gt; &lt;td&gt; &lt;input type="text" disabled="disabled" style="text-align:center; border-width:0; background-color:transparent" id="column-Quantity-&lt;%: cart.RecordID %&gt;" value="&lt;%: cart.Quantity %&gt;"&gt;&lt;/input&gt; &lt;/td&gt; &lt;td&gt; &lt;%: Ajax.ActionLink("Remove from Cart", "RemoveFromCart", new { RecordID = cart.RecordID }, new AjaxOptions {OnSuccess = "handleUpdate" })%&gt; &lt;/td&gt; &lt;/tr&gt; &lt;% } %&gt; &lt;tr&gt; &lt;td&gt;&lt;hr /&gt;Total&lt;/td&gt; &lt;td align="right"&gt; &lt;hr /&gt; &lt;span id="cart-total"&gt;&lt;%: (string)String.Format("{0:F}",Model.CartTotal) %&gt;&lt;/span&gt; &lt;/td&gt; &lt;td align="center"&gt; &lt;hr /&gt; &lt;span id="cart-quantity"&gt;&lt;%: Model.CartQuantity %&gt;&lt;/span&gt; &lt;/td&gt; &lt;td&gt;&lt;hr /&gt;&amp;nbsp;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; </code></pre> <p>No matter how I change it, it doesn't work. I'm using the latest version of Firefox.</p> <pre><code>&lt;td style="width:85%"&gt;Product Name&lt;/td&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload