나는 학생 데이터베이스에 대한 struts2 응용 프로그램을 만들었습니다. 문제는 테이블에 데이터베이스를 표시 한 후 제출 단추를 추가 할 때마다 단추가 테이블의 행 너비와 비슷한 큰 배경으로 둘러싸여 있다는 것입니다. 그 경계를 제거하고 싶습니다. 여기 테이블 뒤의 버튼이 자동으로 행으로 추가됩니다. 어떻게 그들을 분리?
이 어떻게 보이는지 이미지입니다 :![enter image description here](https://i.stack.imgur.com/werxi.png)
참조, 홈 버튼 주위에 회색 배경이 어떻게, 나는 그것을 원하지 않는다. JSP :
<table>
<tr>
<th>RollNo:</th>
<th>Name:</th>
<th>DOB:</th>
<th>Gender:</th>
<th>Address:</th>
</tr>
<%
while(rs.next())
{
%>
<tr>
<td><%=rs.getInt(1) %></td>
<td><%=rs.getString(2) %></td>
<td><%=rs.getString(3) %></td>
<td><%=rs.getString(4) %></td>
<td><%=rs.getString(5) %></td>
</tr>
<%
}
%>
</table>
<%
rs.close();
stmt.close();
conn.close();
}
catch(Exception e)
{
e.printStackTrace();
}
%>
</div>
<br><br>
<s:form action="home.jsp">
<s:submit class="button4" value="Home"></s:submit>
</s:form>
table.css 파일 :
table {
background-color: #dbdbdb;
width: 60%;
}
th,td {
color: #363b3f;
border-bottom: 1px solid #ddd;
}
tr:nth-child(even) {
background-color: #c8c8c8
}
tr:hover {
background-color: #c488d7;
}
button.css 나는 테이블을 캡슐화 시도
.button4
{
background-color: #af4ccf; /* purple */
border: none;
color: black;
padding: 18px;
font-family: 'Amputa';
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 14px;
margin: 4px 2px;
border-radius: 30%;
-webkit-transition-duration: 0.4s; /*Safari*/
transition-duration: 0.4s;
cursor: pointer;
}
.button4:hover
{
background-color: #c986df; /* Light purple */
}
여기
코드의 조각이다 별도의 div에있는 버튼. 또한 다른 테이블에 단추를 넣으려고했습니다. 그러나 아무것도 작동하지 않습니다. 내가 잘못 될 수있는 정확한 지점을 정확히 지적 할 수 없습니다. 배경 테두리가 사라지고 가운데 맞춤 단추를 만들려면 어떻게해야합니까?
코드가 충분하지 않습니다 ... 모든 HTML/CSS를 표시하십시오 ... –
브라우저에서 dev 도구 사용 방법을 익히십시오. –