Various modules use hardcoded table settings for either display of content and/or the "create" pages for submitting content. This makes it difficult/impossible to make table-less layouts that work cross-platform.

Please see http://www.bmannconsulting.com for an example of a table-less layout, and how it breaks in the book module as well as the various "create" pages.

Specific places where this occurs:

  • all book content is displayed with a table wrapped around the content
  • the various "create" pages all use tables inside the form declaration to layout everything; I reallize we still want to control the display of the create pages, so I would suggest either embedded/included stylesheets that can be edited separately (either clearly labelled as part of the "master" CSS file, or as separate stylesheets that are associated with each module)
  • the poll view results; actually uses an embedded stylesheet, but still uses a static table with width=100%

Places where this does NOT happen:

  • edit account
  • view new comments / tracker

Comments

claybutterfly’s picture

Does someone knows a solution for this? Replace this by......???

Steven’s picture

The problem is actually an IE6 bug... if you put a 100% width table into a padded box (div/whatever), then IE uses the padded width of the parent, instead of the inner width of the parent (causing stretching).

The fix is to get rid of all width="100%" attributes for tables in Drupal, which causes only problems when you have tiny items with less than 1 line of text... try the following piece of HTML in your browser of choice:

<div style="padding-left: 100px; padding-right: 100px;"><div style="background-color: #DDD; width: 100%;">This div should fit inside the window with 100 pixel padding on both sides.</div></div><br /><div style="padding-left: 100px; padding-right: 100px;"><table style="background-color: #DDD; width: 100%;"><tr><td>This table should fit inside the window with 100 pixel padding on both sides.</td></tr></table></div>

On IE6, the table will stretch out of the window.

ax’s picture

this IE6 bug goes away if you [use the proper Doctype Declaration|http://www.hut.fi/~hsivonen/doctype.html]. using a transitional or strict DOCTYPE makes your example render perfectly in my ie6.

Anonymous’s picture

al’s picture

Component: book.module » Base system
Assigned: Unassigned » al
Priority: Critical » Normal

I don't know why this was closed. It's still a problem:

al@drupal:~/drupal/drupal> grep -r \<table * | wc -l
     89

Assigning to me, seeing as I seem to be the one fixing these... Only local images are allowed. ing" alt="Smil
ing" />

al’s picture

Component: Base system » other
Category: bug » task
Priority: Normal » Minor
dries’s picture

I just removed a number of hardcoded <table>s (and hardcoded inline CSS) from the aggregator module.

See also http://buytaert.net/temporary/aggregator-makeover.jpg.

killes@www.drop.org’s picture

there are (in non-themable functions) only very few tables left:

1 archive block calendar
1 watchdog.module
3 statistics module.

killes@www.drop.org’s picture

I've just convinced myself that presenting tabular data in tables is actually a good thing.

Anonymous’s picture