c# - Make table with varying width per column keeping the overall width of table constant in gridview in asp.net -


I want different width for different columns. I have specified the width of the particular column but the breadth width is equal to the text. I have checked that CSS is accessible from the background color and it is accessible from the work. But it does not matter how much width its width is the width of the text.

  & lt; Asp: TemplateField HeaderText = "Image" & gt; & Lt; Item style CssClass = "imgclass" /> & Lt; EditItemTemplate & gt; & Lt; ASP: Text Box ID = "TBiage" system code = "multiline" runat = "server" text = '& lt;% # Eval ("imag")% & gt; / & Gt; & Lt; / EditItemTemplate & gt; & Lt; ItemTemplate & gt; & Lt; Asp: Label ID = "lblimage" runat = "server" text = '& lt;% # Eval ("imag")%> & Gt; & Lt; / Asp: label & gt; & Lt; / ItemTemplate & gt; & Lt; / ASP: TemplateField & gt;  

And its CSS is:

  .imgclass {background color: green; Width: 120px; Hidden flurry; }  

Apply maximum-width and minimum-width. Allow maximum-width property to 't cell width and then the value you specify.
In your case this should work.

  .imgclass {max-width: 120px; Background color: green; Hidden flurry; }  

Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -