Results 1 to 3 of 3

Thread: Page break between table rows in html

  1. #1
    Join Date
    Apr 2009
    Posts
    87

    Page break between table rows in html

    I am looking for program in html language, The program contain three rows for displaying employee data and name and id. The page must break between table rows and column should display employee address.

  2. #2
    Join Date
    May 2008
    Posts
    2,297

    Re: Page break between table rows in html

    This will display employee data with two rows and 1 column:
    Code:
    <table border="2">
    <tr>
    <td>row 2, cell 1</td>
    <td>row 2, cell 2</td>
    </tr>
    <tr>
    <td>row 3, cell 1</td>
    <td>row 3, cell 2</td>
    </tr>
    </table>

  3. #3
    Join Date
    Jan 2009
    Posts
    199

    Re: Page break between table rows in html

    Code:
    <HTML>  
    <HEAD>  
               function addRow(empID) { 
      
                var tab = document.getElementById(empID);  
      
                var rowCount = tab.rows.length;  
                var row = tab.insertRow(rowCount);  
      
                var cell1 = row.insertCell(0);  
                var element1 = document.createElement("input");  
                element1.type = "checkbox";  
                cell1.appendChild(element1);  
      
                var cell2 = row.insertCell(1);  
                cell2.innerHTML = rowCount + 1;  
      
                var cell3 = row.insertCell(2);  
                var element2 = document.createElement("input");  
                element2.type = "text";  
                cell3.appendChild(element2);  
      
            }  
      
            function deleteRow(empID) {  
                try {  
                var table = document.getElementById(empID);  
                var rowCount = table.rows.length;  
      
                for(var i=0; i<rowCount; i++) {  
                    var row = table.rows[i];  
                    var chkbox = row.cells[0].childNodes[0];  
                    if(null != chkbox &amp;&amp; true == chkbox.checked) {  
                        table.deleteRow(i);  
                        rowCount--;  
                        i--;  
                    }  
      
                }  
                }catch(e) {  
                    alert(e);  
                }  
            }  
      
        </SCRIPT>  
    </HEAD>  
    <BODY>  
      
        <INPUT type="button" value="Add Row" onclick="addRow('dataTable')" />  
      
        <INPUT type="button" value="Delete Row" onclick="deleteRow('dataTable')" />  
      
        <TABLE id="dataTable" width="350px" border="1">  
            <TR>  
                <TD><INPUT type="checkbox" name="chk"/></TD>  
                <TD> 1 </TD>  
                <TD> <INPUT type="text" /> </TD>  
            </TR>  
        </TABLE>  
      
    </BODY>  
    </HTML>
    Source : viralpatel.net

Similar Threads

  1. How to break rows in Excel 2007
    By connoisseur in forum MS Office Support
    Replies: 2
    Last Post: 17-02-2012, 06:22 PM
  2. Replies: 2
    Last Post: 17-02-2012, 02:09 PM
  3. Replies: 3
    Last Post: 27-11-2010, 05:25 AM
  4. HTML page table width not working in Firefox
    By Ground 0 in forum Software Development
    Replies: 4
    Last Post: 23-08-2010, 06:56 PM
  5. How to create div around table rows
    By Rock Villa in forum Software Development
    Replies: 3
    Last Post: 27-07-2009, 01:18 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,007,106.53050 seconds with 16 queries