12 tables on aspx page: A performance hit?

J

Jason Shohet

Someone in my group created an aspx with 12 tables on it, each with several
rows in the table. In codebehind, we often make 1 or more tables visible /
invisible. (However within each table, there is no need to make individual
rows visible / invisible). I always believed that tables are much more
overhead than just having 1 table with lots of rows (Is that true?). So, I
suggested,

"Just have 1 table, and the <tr> 's we'll make invisible by putting
runat_server = true in the <tr> tags of that table". But there's 1 issue we
have with this, that maybe someone here can help me with:

If we have 1 table with 12 <tr>'s (instead of 12 tables), we still have
items within each <tr> that need to be arranged vertically. Like, 2
datagrids one on top of the other for example. I've seen sometimes that
<br> tags don't work in some browser resolutions / fonts: ie, those 2
datagrids that should be one-on-top of the other may appear on the same row,
unless you put in like, 5 <br> tags or more! Is there a way to avoid this
issue? If so, the 1 table + 12 <tr>'s will work.

OTOH, is there truly a significant performance hit by having 12 tables, vs 1
table with 12 rows, or is this just an old-wives tale and with .NET, it
doesn't make much difference either way? :)

TY Jason Shohet
 
S

Scott M.

Hi Jason,

First, let me say that while tables can cause "slight" delays in page
rendering, it's not much. And, if the table is built correctly (widths are
specified and no contradictory instructions given), there will be virtually
no delay.

Having said that, you could turn on page tracing in .NET and see for
yourself with one page that has the tables and one that doesn't.

As for your <BR><BR><BR><BR> question/issue...You are right that adding
vertical spacing to a page/table is sometimes tricky, but this is an HTML
issue, not a .NET one. The best way to embed empty vertical space in a
table or page is to add:

<P>&nbsp;</P> wherever that space needs to be. No browser will ignore that.
If you plant that into a row of a table, you may find that clears up the
issue.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top