Note that there are some explanatory texts on larger screens.

plurals
  1. POAlign dynamically loaded user controls horizontally inside HTML table cell
    text
    copied!<p>I have a html table which has a element with runat=server. I am loading some user controls inside it from code behind.</p> <pre><code> &lt;td id ="ModuleGridHolder" runat="server" rowspan="3"&gt; &lt;/td&gt; </code></pre> <p>This is the user control HTML</p> <pre><code> &lt;%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ModuleGrid.ascx.cs" Inherits="RadTreeListTest.Controls.ModuleGrid" %&gt; &lt;table cellpadding="0px" cellspacing="0px" style="width:100%;"&gt; &lt;tr&gt; &lt;td colspan="2"&gt; &lt;asp:GridView ID="gvSectionCells" runat="server" Width="100%" AutoGenerateColumns= "true"&gt; &lt;HeaderStyle BackColor="#9999FF" /&gt; &lt;RowStyle HorizontalAlign="Center" /&gt; &lt;/asp:GridView&gt; &lt;/td&gt; &lt;td&gt; &lt;asp:GridView ID="gvSectionTotalCells" runat="server" Width="100%" AutoGenerateColumns="false"&gt; &lt;HeaderStyle BackColor="#9999FF" /&gt; &lt;RowStyle HorizontalAlign="Center" /&gt; &lt;Columns&gt; &lt;asp:BoundField DataField="sumRow" HeaderText="" /&gt; &lt;/Columns&gt; &lt;/asp:GridView&gt; &lt;/td&gt; &lt;/tr&gt; </code></pre> <p>And this is the simplyfied version of the code which is rendering several user controls inside it.</p> <pre><code> foreach loop { ModuleGrid mg = (ModuleGrid)LoadControl("ModuleGrid.ascx"); ModuleGridHolder.Controls.Add(mg); } </code></pre> <p>The problem is all the rendered controls are loading vertically I.E. on top of each other. How do I align them horizontally inside the cell?</p> <p>I have tried using float:left but it is not working?</p>
 

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