I'm happy to say that I've succeeded in importing an Access database into MySQL and getting a table from it to show up in Views. Progress! Thank you for all the help I’ve been getting here to overcome the hurdles along the way.
So now, the first webpage I'm working on has a rather unusual HTML table on it that’s a bit of a hack and I wonder if Views is capable of making it or if I need to find a different way.
You could call what I’m trying to do a “dynamically indented text display.”
'<TR>' + (nLevel == 0 ? '' : '<TD ColSpan="' + nLevel + '"> </TD>') +
'<TD ColSpan="' + (13 - nLevel) + '">' +
(sHeading == '' ? '' : sHeading + ' ') +
(sParty == '' ? '' : '<small>' + sParty + ':</small> ') +
(sURL == '' ? '' : '<a HRef="' + sURL + '" target="_blank">' + sLinkText + '</a>') +
(sNotes == '' ? '' : sNotes) +
In the data table, every row has (a) a value of nLevel between 0 and 12, inclusive, and (b) either a value of sHeading or a value of one or more of the other text variables. Therefore, every row of the HTML table has either a heading or a text block, and whichever it is is indented by an amount controlled by nLevel.
Two elements of simple logical processing stand out there:
- The numeric variable, nLevel, determines the level of indentation by a pair of <TD ColSpan=> tags in which the sum of the “ColSpan” parameters is 13. So there are 13 levels of indentation (from 0 to 12) across the page. (On the current page, the width of the indentations is set by 12 repetitions of “<TD width="25"> </TD>” in the first row of the table.)
- A link is constructed from the variables sURL and sLinkText.
I see that Views allows for the calculation of a math expression in the construction of a table, but I don’t see anything that allows for this kind of programming there. So I’m thinking a Views table won’t work, unless there’s something I don’t know.
It’s possible that an HTML list could work if Views allows for nesting of lists, which would control the indentation. When nLevel increases from one row to the next, it always increases by one, so this gives the same behavior as “<UL>” (plus a bullet, which I could live with). But still, I would have to be guiding Views programmatically in its placement of “<UL>” and “</UL>” tags, and I don’t see how I would do that.
So what is the right way to get Drupal to do the kind of dynamically indented text display described above?
Thanks for your help.