Scripsit Lee Brotzman:
I have a sequence of data tables in an ordered list
That's technically possible, and one might say that it's a logical
structure, if the tables constitute a numbered sequence with nothing between
them. On the other hand, we don't usually use or see such constructs.
Instead, the tables may carry numbering in their captions or - in the case
of consecutive tables with the same column structure - the tables are
combined into one table.
As usual, a URL would make it possible to analyze what the best markup is.
From the styling viewpoint, we can just say that a numbered ("ordered") list
of tables is difficult to style, and if you want tables to appear as
numbered the way items are numbered in a normal <ollist, the practical
approach is to use some workaround like an outer table with numbers in one
column (as explicit data) and the data tables in another.
However it renders on the page with the list item number next to the
bottom of the table
That's somewhat unexpected, but apparently browsers treat the table as if it
were one big letter, and the number is vertically aligned to the baseline of
the "text".
What I want is the list item number next to the first line of table
data, not the last line. I've tried various vertical-align settings
on the ol, li, and table styles with no success.
I'm afraid the positioning of the list number (marker) is beyond the scope
of CSS as currently defined, since the marker properties in CSS 2.0 were not
implemented and are being phased out from the specifications.
But here's some ugly trickery (oh how I hate myself...) that seems to have
the desired effect on IE 7:
- put <brat the start of each <lielement, before the <table>
- use a negative margin corresponding to one line of text for the tables,
e.g.
body { line-height 1.2; }
li table { margin-top: -1.2em; }
(I guess the trick "works" by introducing an empty line at the start of the
list item.)
--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/