473,505 Members | 15,976 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to do rowspan and colspan with DOM

130 New Member
hello all,

i am trying to create a table useing dom and its going well but
was wondering how can i join rowa or join tbs

i can make this kind of table with no problam
_________
|..............|
---------------
|..............|
---------------
|..............|
---------------
|..............|
---------------
but how i can do it like this
__________________
| ..............|..............|
| ..............|..............|
|rowspan |--------------|
| ..............|..............|
| ..............|..............|
|------------------------------|
is there a way?
Oct 31 '07 #1
3 8464
dmjpro
2,476 Top Contributor
How much you tried .... Please show me that code ....

Debasis
Oct 31 '07 #2
Amzul
130 New Member
How much you tried .... Please show me that code ....

Debasis
lol, i posted this before so....
any way here is is :
Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2.  
  3.     document.getElementsByTagName("pre")[0].innerHTML ="";    //clear previues displays in the <pre>
  4.     var body = document.getElementsByTagName("pre")[0];         //put the table in <pre> here </pre>
  5.     var tbl  = document.createElement("table");                 //create table element
  6.     var tblBody = document.createElement("tbody");     
  7.  
  8.         for (var j = 0; j < 4; j++)                     //creating all cells
  9.         { 
  10.             var row = document.createElement("tr");         //creates a table row
  11.             row.setAttribute("height","39");                    //BTW cant control the higeht in  html?
  12.             for (var i = 0; i < 1; i++) 
  13.             {
  14.                 var cell = document.createElement("td");                        //Create a <td> element
  15.                 var linktd='<a href="www.google.com">google</a>';
  16.                 cell.innerHTML = linktd 
  17.                 cell.setAttribute("align","center");                            //set the aligen for the tdl    
  18.                 row.appendChild(cell);            //put the <td> at the end of the table row
  19.             }
  20.             tblBody.appendChild(row);                                 //add the row to the end of the table body
  21.         }
  22.     tblBody.appendChild(row);
  23.     tbl.appendChild(tblBody);
  24.  
  25.         tbl.appendChild(tblBody);                                    //put the <tbody> in the <table>
  26.         body.appendChild(tbl);                          // appends <table> into <body>
  27.         tbl.setAttribute("cellpadding","0");                                    // no cellpadding in the table
  28.         tbl.setAttribute("cellspacing","0");                                    // no cell spacing in the table
  29.         tbl.style.color = color_font;                                 //font color on the links
  30.         tbl.style.backgroundColor = bgcolor_r;                  //bgcolor for table
  31.         tbl.setAttribute("height",size_y_banner);
  32.         tbl.setAttribute("width",size_x_banner);
  33.         tbl.setAttribute("border",border_size1);            
  34. }
  35. </script>
hope u can help :)
Oct 31 '07 #3
acoder
16,027 Recognized Expert Moderator MVP
Use the rowSpan property.
Oct 31 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
1877
by: Martin Brunner | last post by:
Hello! I'm planning to make a music database for my own, but maybe someone else found a script which can what I wont so here is what I'm looking for: The Database only should have these...
28
6727
by: Greg Adourian | last post by:
Hi, I'm breaking my head over the following few lines of code, generated with Photoshop Slices. As soon as the structure is slightly complicated, the output is broken. I can't seem to follow...
19
13336
by: Logix | last post by:
Hello! I'm trying to make a sort of online page building system. In order to do this, I represent my page using a HTML table. One of the most basic templates would be a page divided in six...
6
1972
by: htmlrookie | last post by:
I have a table with three entries. Some text in the first TD with rowspan=2. An image in the second TD and a table in the last TD. Whats happening is, as the text in the first TD grows the table...
12
3947
by: plugwalsh | last post by:
Hi I need to generate an HTML table that looks like the following: (Two cells, A & B) ------------------- | | | | | B | | | | | |--------|
7
349
by: Gawel | last post by:
I need necessarily set RowSpan(ColSpan) property of cell in aspx file(not in cs file). But below statement does not work :(. Any idea ? <TABLE id="Table1" cellSpacing="1" cellPadding="1"...
7
7567
by: Matt Kruse | last post by:
Using the .cellIndex property of a TH element to find out which table column it is over can cause misleading results when the table has cells which have rowspans or colspans greater than 1. See...
0
1986
by: simon | last post by:
hello, relatively new to .net, i'm using vb.net and the 2.0 .net platform I'm trying to display a grid that has a text box on the left in one cell (with a hidden ID), which will be associated...
2
1837
by: gnewsgroup | last post by:
I have a stored procedure that give some data that are sorted by Col1, Col2, Col3, Col4. I have a picture which tells you how I want the data to be presented in a web form. Click below to see...
0
7103
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7307
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7370
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
5035
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3188
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3177
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1532
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
755
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
409
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.