Skip to content

3 Easy Tips for Removing Tables from Mambo

Many people are asking how to get a Mambo site without tables. While you can't get rid of *all* the tables, you can certainly remove a lot of them without doing core hacks, with simple techniques that are available now.

With the few tables left, you can easily get your site to validate XHTML and CSS, and almost WAI 1.0 Priority 1.

Note that this post is about removing as many tables as you can without hacking files. It is not about accessibility per se. It also does not address 3rd Party components.

The first thing to do is to design your template/theme without tables. This means your /template/template_name/index.php relies on CSS for layout rather than tables.

The second thing to do is to call the module with one of three "switches".

First switch: -1
Strips all surrounding code from the module.

Second switch: -2
Puts the module's title in a h3, and wraps the entire thing in a <div class="moduletable">

Third switch: -3
Puts the module's title in a h3, and ads several layers of divs that can be used to apply CSS techniques with rounded corners

This is how you apply the switch:

  <?php mosLoadModule ( 'user1', -2 ); ?>

Note that this applies only to modules, not to mosMainBody (which makes calls to com_content, not to modules). Unfortunately, removing < table > tags from mosMainBody requires hacking the core code, so I will not be dealing with that here.

The third thing to do is to get your menus displayed in Flat lists.

When you go to your module administration, select the menu(s) module(s). In the options, you can select Horizontal, Vertical, or Flat List. The first two options deliver your menu in a table. The third delivers the menu in a <ul>

Note, if you have several layers to your menu, the built-in flat list will not display the child elements. If you need to display child elements, you can use a 3rd Party module called Extended Menu.

I hope that these three little "tricks" help you along the way.

If you enjoyed this post, make sure you subscribe to my RSS feed!

Topic: Mambo Tutorials
Tagged as: accessibility, core code, Mambo, templates, xhtml

Share on FriendFeed

{ 1 comment… read it below or jump to the comment form to share your opinion }

  1. 1 mambotutorials (Mambo Tutorials) May 4th, 2009 at 12:19 pm

    3 Easy Tips for Removing Tables from Mambo: http://tinyurl.com/cdrksb

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
Any comments that look like spam will be treated as spam - this includes SEO titles and use of spurious keywords.

By submitting a comment here you grant this site a perpetual license to reproduce your words and name/web site in attribution.