Layout Question.

  • Thread starter Ed Sproull [MSFT]
  • Start date
E

Ed Sproull [MSFT]

First I'm pretty new to ASP.NET and I'm having a simple problem. I have
small website with a header, sidebar and the the content. I want my content
to appear beside my sidebar which seems to be a pretty standard layout.
However when ever I resize my browser the content resizes below the sidebar.

I've been digging through example websites can't seem to stop this
behaviour. I had one person suggest Tables but I see a few posts that say
you shouldn't use Tables with ASP.NET.

All I need is the topic to go look at. Any suggestions greatly appriciated.

Ed
 
R

Ray Costanzo

Hi Ed,

Absolute purists will say that using tables for layout control is a bad
idea. These are CSS enthusiasts who, in my opinion, are a bit too
idealistic. Strictly speaking, using a table may not make sense for
controlling layout, but if it makes your site appear the way that you need
it to in all the browsers you intend to support, then use it.

As far as controlling how things are handled when the browser is resized,
there are some fundamentals to learn about CSS or inline html tag
attributes. Read some of the things here:
http://www.google.com/search?hl=en&q=control+page+layout+in+a+table+with+css&btnG=Google+Search

Ray at work
 
S

Steve C. Orr [MCSD, MVP, CSM, ASP Insider]

Well you've implied you're not using tables, but you haven't mentioned what
technique you ARE using to try and align things.
I think tables are the easiest way to create such an arrangement and for the
most part I don't really buy into the whole "tables are bad" mentality as
long as they're used judiciously.
I say use tables and make your life easier.
 
G

Guest

Thanks for the replies! I’m just using <DIV> with formatting in the CSS
file. You can go look at it if you want at it
www.elsphoto.com\private\default.aspx
Ignore the header section, I got that under control by using the minimum
width setting but haven’t uploaded it.

Again I’m just a beginner at this but if you ever have any questions on the
internals of the windows shell , I’m in debt to you. ïŠ

Ed Sproull
Senior SDET Core User Experience


Steve C. Orr [MCSD said:
Well you've implied you're not using tables, but you haven't mentioned what
technique you ARE using to try and align things.
I think tables are the easiest way to create such an arrangement and for the
most part I don't really buy into the whole "tables are bad" mentality as
long as they're used judiciously.
I say use tables and make your life easier.

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net



Ed Sproull said:
First I'm pretty new to ASP.NET and I'm having a simple problem. I have
small website with a header, sidebar and the the content. I want my
content to appear beside my sidebar which seems to be a pretty standard
layout. However when ever I resize my browser the content resizes below
the sidebar.

I've been digging through example websites can't seem to stop this
behaviour. I had one person suggest Tables but I see a few posts that say
you shouldn't use Tables with ASP.NET.

All I need is the topic to go look at. Any suggestions greatly
appriciated.

Ed
 
K

Kevin Spencer

I wouldn't label people who recommend divs over tables "Absolute Purists."
This implies an almost "religious" connotation to the practice. In fact, the
use of divs over tables is very practical. In terms of layout, divs and CSS
are much more flexible and extensible. A table locks the contained elements
into a specifically-ordered tabular format, while proper use of divs allows
content to be rearranged at will. As web sites generally evolve in terms of
layout, the ability to change layout without changing content is highly
cost-effective. It also enables the same XHTML element layout to be reused
in many applications without change, if structured correctly. By combining
div layout with ASP.Net Controls, such as substituting Panels for divs, you
further extend the flexibility and extensibility of the model.

I am not "averse" to using tables within pages, as they are clearly superior
for the display of data with a tabular and fixed format. Displaying database
data in a grid layout, for example, is probably best done with tables.
However, using tables for the page layout of entire pages is short-sighted,
in terms of design.

See http://csszengarden.com for some startling examples of the flexibility
and power of CSS with div layout.

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
 
E

Ed Sproull [MSFT]

For the time being I used a Table to hold my Sidebar and Content to prevent
the content from jumping around when the window is resized.

If possible, could you give me the basic attributes that you would set in
CSS to have three DIV, horizontal across a page and not have them jump when
resizing the window? Currently I have a sidebar, a slide show and some text
and had to resort to the table to keep them horizontal. I've tried a bunch
of combinations of alignment and min-width but on resize to a small width
(smaller than the size of the three sections) my content wants to jump over
to the left and under the sidebar. If I set a margin-right it just resizes
below the sidebar.

Again thanks for your replies.

Ed
 

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

Staff online

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,162
Latest member
GertrudeMa
Top