私は html ファイルを変更していますが、それを扱う必要があります。頭には、いくつかのボタンを作成する一連の JavaScript があり、すべてのボタンに id="#content" というラベルが付けられます。
次に、本文では、すべてのボタンを列に配置するだけです。<div id="content" align:"center"></div>
ボタンを個別に移動できるようにしたい、つまりテーブルに配置したい。これどうやってするの?
コード:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content = "height = device-height, width = 420, user-scalable = no" />
<title>Direct Current GUI</title>
<script type="text/javascript" src="/webiopi.js"></script>
<script type="text/javascript">
webiopi().ready(function() {
var content, button;
content = $("#content");
// create a "FORWARDS" labeled button for GPIO 7
button = webiopi().createGPIOButton(7, "FORWARDS");
content.append(button); // append button to content div
// create a "REVERSE" labeled button for GPIO 8
button = webiopi().createGPIOButton(8, "REVERSE");
content.append(button); // append button to content div
});
</script>
</head>
<body>
<table>
<tbody>
<tr><td id="content"></td></tr>
</tbody>
</table>
</body>
</html>