Results 1 to 8 of 8

Thread: [Bug] Nested Tables Limit?

  1. #1

    Thread Starter
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    [Bug] Nested Tables Limit?

    There seems to be a limit on the number of nested tables in browsers, I think.

    IE stops at 25, FireFox stops at 31.

    Place the following in a webform in Visual Studio, after the @Page directive:

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
    <HTML>
    	<HEAD>
    		<title>WebForm1</title>
    		<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
    		<meta name="CODE_LANGUAGE" Content="C#">
    		<meta name="vs_defaultClientScript" content="JavaScript">
    		<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
    	</HEAD>
    	<body MS_POSITIONING="GridLayout">
    		<form id="Form1" method="post" runat="server">
    			<asp:Button id="Button1" style="Z-INDEX: 101; LEFT: 128px; POSITION: absolute; TOP: 80px" runat="server"
    				Text="Button"></asp:Button>
    			<asp:PlaceHolder id="phTables" runat="server"></asp:PlaceHolder>
    		</form>
    	</body>
    </HTML>
    In the codebehind,

    Code:
    		private void Button1_Click(object sender, System.EventArgs e)
    		{
    			
    			this.phTables.Controls.Add(AddHTMLTableControl(50));
    
    		}
    
    		private Table AddHTMLTableControl(int level)
    		{
     
    			Table t = new Table();
    			t.Width = Unit.Percentage(100);
    			t.Height = Unit.Point(100);
    			t.BorderWidth = 1;
    			TableRow tr = new TableRow();
    			TableCell tc = new TableCell();
    			tr.Cells.Add(tc);
    			t.Rows.Add(tr);
    			for (int i = 0; i < level; i++)
    			{
    				Table t1 = new Table();
    				t1.Width = Unit.Percentage(100);
    				t1.Height = Unit.Point(100);
    				t1.BorderWidth = 1;
    				TableRow tr1 = new TableRow();
    				TableCell tc1 = new TableCell();
    				Label lbl = new Label();
    				lbl.Text = "level" + i;
    				// lbl.Width = 26;
    				tc1.Controls.Add(lbl);
    				tr1.Cells.Add(tc1);
    				t1.Rows.Add(tr1);
    				tc.Controls.Add(t1);
    				tc = tc1;
    			}
    			return t;
    		}
    Now, run the page, click on the button.

    Why the limit?

  2. #2
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: [Bug] Nested Tables Limit?

    Quote Originally Posted by mendhak
    There seems to be a limit on the number of nested tables in browsers, I think.

    IE stops at 25, FireFox stops at 31.

    Place the following in a webform in Visual Studio, after the @Page directive:

    Now, run the page, click on the button.

    Why the limit?
    If I made a browser I'll only limit it to 10.
    why all those nested tables? it'll look terrible and hard to read after all
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

  3. #3

    Thread Starter
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [Bug] Nested Tables Limit?

    Aesthetical reasoning is irrelevant. We're talking major browsers here. No one would have a hardcoded limit in their browser, that's just poor programming. But the fact that there is a limit implies some sort of limitations that they must have come across in the rendering of the page.

    As for the reason I'm doing it, someone I know brought it up and I've been curious as to the reasoning behind it.

  4. #4

    Thread Starter
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [Bug] Nested Tables Limit?

    Come on people, at least speculate. Make guesses, anything logical. Act like Spock for a day.

  5. #5
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: [Bug] Nested Tables Limit?

    Quote Originally Posted by mendhak
    Come on people, at least speculate. Make guesses, anything logical. Act like Spock for a day.
    This means either people are not interested in this topic or they don't think it's not a big deal

    EDIT: by the way, congratulations on the 18,000 posts count
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

  6. #6
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: [Bug] Nested Tables Limit?

    Quote Originally Posted by mendhak
    No one would have a hardcoded limit in their browser, that's just poor programming.
    Are you nuts? Don't you remember the 64K limit on DOS and the resulting, googy, segment offset architecture? To think that there has to be a logical explanation for something like this is to ignore the vast history of irrational decisions in computer and language designs in general.

    Somebody probably came up with some design that had a limit of x and everybody else said "yeah, nobody will need to go beyond that." Then nobody actually took any steps to change the limit.
    My usual boring signature: Nothing

  7. #7
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: [Bug] Nested Tables Limit?

    Dunno about IE, but for Gecko: Bugzilla 58917

    If you think about it, with each table you have a row and a cell also, so that's 3 elements. So it's actually bombing out at 93 nested table-related elements.

    Possibly the same type of issue in IE, although we know IE's parser works quite differently.

  8. #8

    Thread Starter
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [Bug] Nested Tables Limit?

    Hmm, alright. I am convinced.

    Thanks to the bunch of you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width