:: Forum >> General/Off-topic >>

multirow table header

how to do this t header? with rowspan,colspan and without sort...
<html>
<
body>
<
table border="1">
<
thead>
    <
tr>
        <
th rowspan="2">text</th>
        <
th colspan="2">text</th>
    </
tr>
    <
tr>
        <
th>text</th>
        <
th>text</th>
    </
tr>
</
thead>
<
tbody>
    <
tr>
        <
td>1</td>
        <
td>2</td>
        <
td>3</td>
    </
tr>
    <
tr>
        <
td>4</td>
        <
td>5</td>
        <
td>6</td>
    </
tr>
    <
tr>
        <
td>7</td>
        <
td>8</td>
        <
td>9</td>
    </
tr>

</
tbody>
</
table>
</
body>
</
html
A Maks
Tuesday, February 2, 2010
sorry
all code
<html>
<
head>
<
title>ActiveWidgets Examples</title>
<
script src="../../runtime/lib/aw.js"></script>
<
link href="../../runtime/styles/system/aw.css" rel="stylesheet"></link>
</
head>
<
body>

<
table id="test" style="display:none">
<
thead>
    <
tr>
        <
th rowspan="2">text</th>
        <
th colspan="2">text</th>
    </
tr>
    <
tr>
        <
th>text</th>
        <
th>text</th>
    </
tr>
</
thead>
<
tbody>
    <
tr>
        <
td>1</td>
        <
td>2</td>
        <
td>3</td>
    </
tr>
    <
tr>
        <
td>4</td>
        <
td>5</td>
        <
td>6</td>
    </
tr>
    <
tr>
        <
td>7</td>
        <
td>8</td>
        <
td>9</td>
    </
tr>

</
tbody>
</
table

<
script>

var 
obj = new AW.UI.Grid;

var 
oTable document.getElementById('test');
var 
RowsLength oTable.rows.length;
var 
CellsLength oTable.rows.item(1).cells.length;
obj.setCellText(function(ij){return oTable.rows.item(j).cells.item(i).innerText});
//obj.setHeaderText(myHeader);
obj.setColumnCount(CellsLength);
obj.setRowCount(RowsLength);
obj.setVirtualMode(false);
obj.setCellEditable(false);
document.write(obj);
</
script>


</
body>
</
html
A Maks
Tuesday, February 2, 2010
I've seen this come up a few times on these forums. To my knowledge the grids don't support spans like you would use in a normal table.
Mike
Tuesday, February 2, 2010
The default AW Grid has a single header row, but you can include the patch found about halfway down on the thread below to include additional rows, and multi-column-spanning headers.

/javascript.forum.16298.15/sorting-on-second-header-row.html

Also note that colspan and rowspan are not supported in the actual body of the grid, only in the headers with that patch.
John
Thursday, February 4, 2010

Post a reply:

Text:
Name:

Back to support forum

Forum search