3.2.0

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
February 2,
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(i, j){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
February 2,
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
February 2,
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.

http://www.activewidgets.com/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
February 4,

This topic is archived.

See also:


Back to support forum