Tam
|
| Posted: 08/11/2004, 9:40 PM |
|
Hi there,
Here is my issue. I have 10 records in a table. By using CCS alternate record, I am able to display them like this:
1 2
3 4
5 6
7 8
9 10
However, since I would like to display 3 records in one row like following:
1 2 3
4 5 6
7 8 9
10
Would anyone work on this issue before? Please help.
Thank you.
|
|
|
 |
Tam
|
| Posted: 08/13/2004, 11:53 AM |
|

My mistake, I thought by using alternative records, I could display like
1 2
3 4
5 6
...
but it doesn't work that way. It looks like this
1 2 3 4 5 6 ....
Please help.!!!
|
|
|
 |
DonB
|
| Posted: 08/16/2004, 9:05 AM |
|
This is a layout issue, thus it's a matter of controlling the HTML output.
The HTML "row" you want is different than the Data Source "row" that your
database provides. But this is not really a problem.
The solution lies with managing the output of <TR> and </TR> tags. This can
be accomplished by taking the "hardcoded" ones out of the HTML file that CCS
gives you and putting them in via the Before Show Row event.
The technique requires that you do the following:
1. Define a variable "globally" - meaning at the top level of your ASP page
(meaning, right after the "<%" at the top of the "event" page).
2. Set this variable to 'one' in the Page Before Show event
3. Increment the variable in the Before Show Row event, when it reaches 3,
reset it to 1
4. Put Label controls (or template variables) into the page where the <tr>
and </tr> were. Set them to "html" content type and give them both Before
Show events.
5. Evaluate your incrementing variable in the label events - when the value
is 3, set them to <tr> and</tr>, respectively. Otherwise, set them to empty
strings.
This let's you control when the visible row occurs - giving you three "Data
Source" rows per "visible" row. This may require some fine-tuning (suppose
there are only 5 data rows - you'll need to pad the visible row with one
blank column).
Actually, you might find it works better to replace the <table> structure
with one based on <div> or <span> tags, although this means more hacking on
the HTML file. For insight into this, look through Google for "html box
model". Basically, the technique is treating the "div" elements as "boxes"
and you use CSS directives to establish how these boxes are
"stacked" -either vertically or horizontally on the page.
What you have encountered is the flaw in <table> formatting. Not that the
table concept is flawed, just that you aren't really striving for tabular
layout in the manner that is best suited to the <table> element. CCS leads
one to think only in terms of tables, because that's all it generates. But
"think outside the box" (er, maybe that should be "inside" and you will
see a whole new set of possibilities.
--
DonB
http://www.gotodon.com/ccbth
"Tam" <Tam@forum.codecharge> wrote in message
news:6411af4a571f03@news.codecharge.com...
> Hi there,
> Here is my issue. I have 10 records in a table. By using CCS alternate
> record, I am able to display them like this:
>
> 1 2
> 3 4
> 5 6
> 7 8
> 9 10
>
> However, since I would like to display 3 records in one row like
following:
>
> 1 2 3
> 4 5 6
> 7 8 9
> 10
>
> Would anyone work on this issue before? Please help.
>
> Thank you.
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
 |
|