Re: [xsl] flattening html table with row/colspans

Subject: Re: [xsl] flattening html table with row/colspans
From: Graham Seaman <graham@xxxxxxxxx>
Date: Thu, 17 Oct 2002 15:13:40 +0100 (BST)
On Wed, 16 Oct 2002, Joerg Heinicke wrote:

> Does this mean, from a table like the following
> 
> <table>
>    <tr>
>      <td>1</td>
>      <td colspan="2">2</td>
>      <td rowspan="2">3</td>
>    </tr>
>    <tr>
>      <td>4</td>
>      <td>5</td>
>      <td>6</td>
>    </tr>
> </table>
> 
> you want to get the following output:
> 
> 1
> 2
> 3
> 4
> 5
> 6
> 
> or should the values from the <td>s with col- or rowspan be repeated:
> 
> 1
> 2
> 2
> 3
> 4
> 5
> 6
> 3
> 
Neither. I would like 
1
4
2
5
6
3

I'm ordering the output by column, not by row, and I don't want to repeat
the contents of any td. The contents of a td should be printed out as soon
as possible.

> In the second case: What should happen in conflict situations (e.g. 
> colspan at <td> with value 6)?


The general idea I'm going by, is that if you displayed the table in a
browser with the numbers aligned to the top and left in each td, the
sequence output should follow that taken by reading vertically down each
visual column. I'm not sure what effect adding a colspan to 6 would be
intended to create - on my browser (mozilla) it overlaps the 6 and 3. I'm
assuming that any input I have does give a sensible visual layout.
  
On the other hand, I guess there may be conflict situations I haven't
thought of. And I don't expect to always be able to make sense of a visual
layout; that's why I just assumed blind application of the rules I gave in
the last email.

Does all this mean you think there may be a simple way to do this?

Cheers
Graham

PS Another example (this is the one I've been using as a test case):
<table>
    <tr>
      <td colspan="7">1</td>
    </tr>
    <tr>
	<td rowspan="4">2</td>
        <td rowspan="4">3</td>
	<td colspan="3">4</td>
	<td rowspan="4">5</td>
        <td rowspan="4">6</td>
    </tr>
    <tr>
      <td colspan="3">7</td>
    </tr>
    <tr>
        <td>8</td>
        <td>9</td>
        <td>10</td>
    </tr>
        <td colspan="3">11</td>
        <td colspan="7">12</td>
    </tr>
</table>

For this I'm trying to get the output
1,2,12,3,4,7,8,11,9,10,5,6

but you probably need to display the table  to see why


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread