私はテーブルを持っています。 HTML
<div class="row-fluid">
<table class="table table-striped" id="table-visual-features">
<thead>
<tr>
<th>Visual Feature</th>
<th>Type [currently not used]</th>
<th>Description</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<tr><td>A11</td><td>Numeric [1..30]</td><td>Values to be mapped to the S1-axis</td><td><button class="action-change">edit</button> <button class="btn btn-mini btn-danger action-remove-visual-feature">remove</button></td></tr>
<tr><td>A21</td><td>Numeric [1..10 ]</td><td>Values to be mapped to the S2-axis</td><td><button class="action-change">edit</button> <button class="btn btn-mini btn-danger action-remove-visual-feature">remove</button></td></tr>
<tr><td>A31</td><td>Numeric [1..20 ]</td><td>Values to be mapped to the S3-axis</td><td><button class="action-change">edit</button> <button class="btn btn-mini btn-danger action-remove-visual-feature">remove</button></td></tr>
</tbody>
</table>
</div>
値をテーブルからこのフォームに変換したい
var features = {
features: {
"A11": {"type_feature": "Numeric [1..30]", "description_feature": "Values to be mapped to the S1-axis"},
"A21": {"type_feature": "Numeric [1..10]", "description_feature": "Values to be mapped to the S2-axis"},
"A31": {"type_feature": "Numeric [1..20]", "description_feature": "Values to be mapped to the S3-axis"}
}
};
行の最初のセルの値を取得します。「A11」です。行の 2 番目のセルの値は「数値 [1..30]」です。行の 3 番目のセルの値は、「S1 軸にマップされる値」です。私たちは最初のエントリー
features: {
"A11": {"type_feature": "Numeric [1..30]", "description_feature": "Values to be mapped to the S1-axis"}}
これは私のjsfiddle http://jsfiddle.net/7q3KP/です
値を変換するのを手伝ってください。前もって感謝します