我可以浮动两个表,一个在左侧,一个在右侧。但是,左侧的表大小与右侧的表不对称。我无法相等地显示表格大小。我应该怎么做才能平等地并排显示表格?
.html
网页文件
<div class="floatleft">
<div class="left">
<div class="row">
<div class="col-md-3">
<%
Connection conn = null;
Class.forName("com.mysql.jdbc.Driver");
String connURL = "jdbc:mysql://localhost/test?user=1234&password=1234";
conn = DriverManager.getConnection(connURL);
String sql = "select * from test";
PreparedStatement pstmt=conn.prepareStatement(sql);
ResultSet rs = pstmt.executeQuery();
%>
</div>
</div>
<div>
<p<u>Arm</u></a></font></p>
<table>
<tr>
<th >Arm Exercises</th>
<th >Number of times</th>
<th colspan='1'> </th>
<%
String sql1="";
{
sql1 = "select * from test";
PreparedStatement pstmt1=conn.prepareStatement(sql1);
ResultSet rs1 = pstmt1.executeQuery();
while(rs1.next()){
String id = rs1.getString("ID");
out.println("<tr>");
out.println("<td style = 'width: 85%'>");
out.println(arm);
out.println("</td>");
%>
<td>
<textarea cols="2"></textarea>
</td>
<%
out.println("</tr>");
}
conn.close();
}
%>
</table><br>
</div>
只需将表放在带有类名的div 元素中即可。
<div class="floatleft">
<table>
</table>
<div class="floatright">
<table>
</table>