How to put data in the right place of a table?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to put data in the right place of a table?

926件の閲覧回数
winmaxi
Contributor I

I have constructed a table, and I have a bunch of data to send to the webpage. How do I define where I want to put each data in each cell of the table.

for example.
Here are two commands in my parse_val function.
I got the value from a C file, and parse it.
The next command tells where to put the value; it is after "Mode:".
__________________________________________________ ___
hvac_value[0] = parsed[0];
mode.innerHTML = "<h1>Mode: "+hvac_value[0]+"</h1>";
__________________________________________________ ___

But now I have a table.
It is written in this way:
<th scope="row"><p>Results </p>
</th>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
.......
In each row, there are a bunch of cells. I want to put different values in each of the empty data.
As there is nothing in each cell now; and each cell have <td></td> in front and behind.
I don't know how I can define where I want to put each data.


Is there anyone can help me with this?

ラベル(1)
タグ(1)
0 件の賞賛
返信
1 返信

621件の閲覧回数
JonSmith
Contributor II

Hi,

 

May be you can use this way:

<th scope="row"><p>Results </p></th><td><div id="result_1"> </div></td><td><div id="result_2"> </div></td><td><div id="result_3"> </div></td>

 

and then in your parse_val function:
 
result_1.innerHTML  = parsed[0];result_2.innerHTML  = parsed[1];result_3.innerHTML  = parsed[2];

 

Regards!

 

0 件の賞賛
返信