ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.How to put Horizontal scroll bar for dynamic html table Header in code behind<p>You can put vertical scrollbar and&nbsp;keep header fixed&nbsp;using <a href="http://www.aspsnippets.com/Articles/Scrollable-GridView-with-Fixed-Headers-using-jQuery-Plugin.aspx">jQuery Scrollable Plugin </a>but not horizontal</p> <pre class="brush: xml">&lt;html xmlns=&#34;http://www.w3.org/1999/xhtml&#34;&gt; &lt;head id=&#34;Head1&#34; runat=&#34;server&#34;&gt; &lt;title&gt;Untitled Page&lt;/title&gt; &lt;script type=&#34;text/javascript&#34; src=&#34;http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js&#34;&gt;&lt;/script&gt; &lt;script type = &#34;text/javascript&#34; src = &#34;scripts/ScrollableGridPlugin.js?22_12&#34;&gt;&lt;/script&gt; &lt;script type = &#34;text/javascript&#34;&gt; $(document).ready(function () { $(&#39;#Table1&#39;).Scrollable({ ScrollHeight: 50 }); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;form id=&#34;form1&#34; runat=&#34;server&#34;&gt; &lt;asp:Panel ID = &#34;Panel1&#34; runat = &#34;server&#34;&gt; &lt;/asp:Panel&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </pre> <p>&nbsp;</p> <pre class="brush: csharp"> protected void Page_Load(object sender, EventArgs e) { Table table = new Table(); table.ID = &#34;Table1&#34;; table.BorderStyle = BorderStyle.Solid; //Add Header Row TableRow row = new TableRow(); TableHeaderCell headerCell = new TableHeaderCell(); headerCell.Text = &#34;Item&#34;; row.BackColor = Color.Green; row.Controls.Add(headerCell); headerCell = new TableHeaderCell(); headerCell.Text = &#34;Price&#34;; row.Controls.Add(headerCell); table.Controls.Add(row); //Add DataRow row = new TableRow(); TableCell cell = new TableCell(); cell.Text = &#34;Shirt&#34;; row.Controls.Add(cell); cell = new TableCell(); cell.Text = &#34;200&#34;; row.Controls.Add(cell); row.BackColor = Color.Yellow; table.Controls.Add(row); //Add Colspan Row row = new TableRow(); row.BorderStyle = BorderStyle.Solid; cell = new TableCell(); cell.Text = &#34;Colspan Row&#34;; cell.ColumnSpan = 2; row.Controls.Add(cell); row.BackColor = Color.Brown; table.Controls.Add(row); //Add DataRow row = new TableRow(); cell = new TableCell(); cell.Text = &#34;Tie&#34;; row.Controls.Add(cell); cell = new TableCell(); cell.Text = &#34;30&#34;; row.Controls.Add(cell); table.Controls.Add(row); row.BackColor = Color.Beige; Panel1.Controls.Add(table); }</pre> <p><span style="text-decoration: underline;"><strong>Demo</strong></span></p> <div id="Panel1"> <table id="Table1" style="border-style: Solid;" border="0"> <tbody> <tr style="background-color: green;"><th>Item</th><th>Price</th></tr> <tr style="background-color: yellow;"> <td>Shirt</td> <td>200</td> </tr> <tr style="background-color: brown; border-style: Solid;"> <td colspan="2">Colspan Row</td> </tr> <tr style="background-color: beige;"> <td>Tie</td> <td>30</td> </tr> </tbody> </table> </div> <script type="text/javascript" src="http://www.aspsnippets.com/scripts/ScrollableGridPlugin.js?22_12"></script> <script type="text/javascript">// <![CDATA[ $(document).ready(function () { $('#Table1').Scrollable({ ScrollHeight: 50 }); }); // ]]></script> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/200264/How-to-put-Horizontal-scroll-bar-for-dynamic-html-table-Header-in-code-behind/https://www.aspforums.net:443/Threads/200264/How-to-put-Horizontal-scroll-bar-for-dynamic-html-table-Header-in-code-behind/Wed, 18 Jul 2012 05:12:49 GMT