The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> How do you use colspan and rowspan in HTML/XML table?
Roura
post Mar 31 2013, 12:20 PM
Post #1





Group: Members
Posts: 2
Joined: 31-March 13
Member No.: 18,935



I have a simple table that uses data island to retrieve data from the XML elements. However, i have difficulties using colspan and rowspan.

For example, in the second row, i would like to merge the "first" and "last" cells together into one cell. How do i do that?

Help please. Thanks.


CODE


<head>
    <xml id="peoples">
        <?xml version="1.0"?>
        <peoples>
            <people>
                <first>bob</first>
                <last>martin</last>
                <age>1970</age>
            </people>
            <people>
                <first>Clark</first>
                <last>josh</last>
                <age>1980</age>
            </people>
            <people>
                <first>Kent</first>
                <last>joseph</last>
                <age>1952</age>
            </people>
            <people>
                <first>Dan</first>
                <last>Isaac</last>
                <age>1966</age>
            </people>
          
        </peoples>
    </xml>
</head>
<body>
    <table width="100%" cellpadding="0px" cellspacing="2px" border="1px" datasrc="#peoples" datapagesize="2" id="myTable">
        <thead>
            <tr>
                <th>First</th>
                <th>Last</th>
                <th>Age</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td><span datafld="First"></span></td>
                <td><span datafld="Last"></span></td>
                <td><span datafld="Age"></span></td>
            </tr>
        </tbody>
    </table>

    <input type="button" onclick="myTable.firstPage ()" value="|< First " />
    <input type="button" onclick="myTable.previousPage ()" value="< Previous " />
    <input type="button" onclick="myTable.nextPage ()" value=" Next >" />
    <input type="button" onclick="myTable.lastPage ()" value=" Last >|" />
</body>
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Mar 31 2013, 12:53 PM
Post #2


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 18,351
Joined: 9-August 06
Member No.: 6



Should the merged cell contain both SPANs or just one of them?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Roura
post Mar 31 2013, 01:01 PM
Post #3





Group: Members
Posts: 2
Joined: 31-March 13
Member No.: 18,935



QUOTE(pandy @ Mar 31 2013, 12:53 PM) *

Should the merged cell contain both SPANs or just one of them?


Only one of them.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Mar 31 2013, 03:53 PM
Post #4


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 18,351
Joined: 9-August 06
Member No.: 6



OK. Unless I miss something...

CODE

<tr>
<td colspan="2"><span datafld="First"></span></td>
<td><span datafld="Age"></span></td>
</tr>
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 19th August 2019 - 03:26 PM