Home > Web Front-end > HTML Tutorial > How to design a table that can add rows? _html/css_WEB-ITnose

How to design a table that can add rows? _html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:38:27
Original
1310 people have browsed it

  <tr>    <td>1</td>      </tr>  <tr>    <td>2</td>      </tr>  <tr>    <td>3</td>      </tr>  <tr>    <td>4</td>      </tr>  </table>
Copy after login

Suddenly I discovered that if the company continues to need rows in the table, how to add them?


Reply to discussion (solution)

js code: Insert rows

table.insertRow(i)//插入第(i+1)行,行数(参数)从零开始 
Copy after login

Dynamically add rows to the table to display information, Achieve scrolling effect

Reference jquery:

http://www.blogjava.net/absolutedo/archive/2009/03/13/259488.html

You also You can try the datagrid of easy ui, you can get data from the background, or you can call js from the front desk to add rows

http://www.jeasyui.net/demo/338.html

Simply design the table to be dynamic, and design adding rows as a method

You can refer to this case and define the method of adding rows by yourself


< ;html>


Add row to table


















1 1
2 2
3 3


source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template