Wrox Programmer Forums
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 27th, 2004, 11:45 PM
Authorized User
 
Join Date: Jun 2003
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to tgopal
Default RowSpan

Hi
Is it possible to set the rowspan for a <td> dynamically using javascript.

Thanks
T.Gopalakrishnan

 
Old September 27th, 2004, 11:55 PM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 449
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to r_ganesh76
Default

You can change the rowspan and columnspan of <td> using javascript. You can change the values of the properties rowSpan colSpan.

Regards
Ganesh
 
Old September 28th, 2004, 02:01 AM
Authorized User
 
Join Date: Jun 2003
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to tgopal
Default

Can u provide some sample code

 
Old September 28th, 2004, 02:24 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 449
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to r_ganesh76
Default

hope u find this useful


<html>
    <head>
        <title>Test Row Span</title>
        <script language="javascript">
        function SpanRows()
        {
            var Rows = txtRows.value;
            tblTest.rows[0].cells[0].rowSpan = 2
        }
        </script>
    </head>
    <body>
        <table id="tblTest" border="1">
            <tr>
                <Td>Test</Td>
                <Td>Test1</Td>
            </tr>
            <tr>
                <Td>Test2</Td>
                <Td>Test3</Td>
            </tr>
            <tr>
                <Td>Test4</Td>
                <Td>Test5</Td>
            </tr>
        </table>

        <input type="button" onclick="SpanRows()" value="Span">
    </body>
</html>

Regards
Ganesh
 
Old September 28th, 2004, 02:25 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 449
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to r_ganesh76
Default

sorry

please remove the line
var Rows = txtRows.value;


Regards
Ganesh
 
Old September 28th, 2004, 03:18 AM
Authorized User
 
Join Date: Jun 2003
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to tgopal
Default

Thanks Ganesh
Its working

 
Old September 28th, 2004, 03:35 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 449
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to r_ganesh76
Default

cheers Gopal:)

Regards
Ganesh





Similar Threads
Thread Thread Starter Forum Replies Last Post
Filling the gaps of rowspan/colspan sources maikm XSLT 3 August 27th, 2008 03:36 AM
Using Rowspan in datagrid bala24 General .NET 2 February 15th, 2008 03:21 AM
Gridview Rowspan and ColumnSpan ramuis78 ASP.NET 2.0 Professional 3 June 25th, 2007 09:29 PM
RowSpan not working like I thought MLaGrange ASP.NET 2.0 Basics 0 February 20th, 2006 10:13 AM
ROWSPAN PROBLEM saravananedu HTML Code Clinic 3 July 27th, 2004 03:58 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.