Powering ASP.Net By CSS

When developing a web site one can choose between creating a CSS-based or TABLE-based web site. Both types of layouts have advantages and disadvantages and perform quite differently.

TABLE-based layouts web sites have the flowing facts:

- They're easy to use and implement (compared to CSS-layouts).

- WYSIWYG (What You See Is What You Get) editors like FrontPage and Dreamweaver make it very easy for developers to include them.

- Tables "break" on various browsers (newer and older versions) thus producing layout dysfunctions.

- Increase almost unnecessarily the HTML/text ratio. This means that other options could be used to create layouts that produce smaller page files by employing less HTML tags.

And

CSS-based layouts web sites have the flowing facts:

- Widely supported by modern browsers but not by older browsers

- Allows extreme flexibility in positioning

- Increases usability by encouraging liquid design

- Keeps the HTML/text ratio at a low level thus decreasing load time

- Allows the display of main content first while the graphics load afterwards

You can think now that CSS layout is more powerful than table based layout and Tables should only be used in extreme cases where there is no other viable alternative.

So if you need to improve your ASP.net Web Site performance and layout then you need to add CSS functionality to your site by using elements other than table if it possible like DIV, UI, LI … with CSS

But what I can do with ASP.Net server controls? You can use ASP.NET CSS Friendly Control Adapters 1.0 that provided more flexibility for customizing the rendered HTML. For example, the Menu control makes it simple to add a menu to a web site, but it would be better if it didn't create <table> tags and was easier to style using CSS. Happily, it's easy to customize and adapt the Menu control to generate better HTML. Indeed, you can modify any ASP.NET control so it produces exactly the HTML you want.

For more details:

ASP.NET 2.0 CSS Friendly Control Adapters 1.0

CSS Layouts Vs. Table Layouts - Alternate Browsers and Accessibility Issues

3 Comments

  • Tables are still good for tabular data, but we shouldn't be using them for layout any more. It would be much easier to persuade people of this if all CSS implementations were created equal, which they aren't.

  • Hi Joe,
    Thanks for your comment you are right, but I just want to focus on the benefits of CSS and the power of it to improve the layout and performance of website and the ability to change server controls like menu rendering way to be CSS friendly by using ASP.NET 2.0 CSS Friendly Control Adapters 1.0

  • Just wondering...do you guys have many sites done with tables that you would like to turn into CSS, but just can't afford to spend the time to actually do the move?

Comments have been disabled for this content.