테이블 여러개 가운데 정렬하는 법 질문드립니다.
관련링크
본문
안녕하세요. 매번 질문드리는 초보입니다.
버튼은 만들줄을 몰라서... table로 버튼을 만들고 있습니다.
아래 그림처럼 float:left로 table을 나란히 놓고 가운데 정렬하고 싶은데 뭐가 문제인지 안되네요...ㅠ
무엇이 잘못되었는지 질문드립니다. 감사합니다.
<center>
<table style="float:left;table-layout:fixed;width:300px cellpadding=0 cellspacing=0">
<td style="border:1px;border-color:#ccc;border-radius:2px;background:#ccc;padding:15px;font-size:1.2em;font-weight:bold;"><a href="https://goodjobpt.com/hosp" target="_self"> 병원 </a></td>
</table>
<table style="float:left;table-layout:fixed;width:300px cellpadding=0 cellspacing=0">
<td style="border:1px solid #ccc;border-radius:2px;background:#fff;padding:15px;font-size:1.2em;font-weight:bold;"><a href="https://goodjobpt.com/bbs/inst.php" target="_self"> 교육 </td>
</table>
<table style="float:left;table-layout:fixed;width:300px cellpadding=0 cellspacing=0">
<td style="border:1px solid #ccc;border-radius:2px;background:#fff;padding:15px;font-size:1.2em;font-weight:bold;"><a href="https://goodjobpt.com/bbs/prac.php" target="_self"> 실습 </td>
</table>
<table style="float:none;table-layout:fixed;width:300px cellpadding=0 cellspacing=0">
<td style="border:1px solid #ccc;border-radius:2px;background:#fff;padding:15px;font-size:1.2em;font-weight:bold;"><a href="https://goodjobpt.com/bbs/univ.php" target="_self"> 대학 </td>
</table>
<br><br>
<span style="float:none"><font size="5px"><b>물리치료사 전·현직자들의 병원 리뷰</b></font></span>
</center>
답변 2
테이블 치우고 간단하게 이방식은 어떠신가요
<style>
.subdesc {
text-align: center;
}
.subdesc a {
display: inline-block;
padding: 1em;
text-align: center;
border: 1px solid #ccc;
border-radius: 2px;
background: #fff;
color: #000;
font-weight:bold;
text-decoration: none;
}
.subdesc a:hover {
background: #ccc;
}
.subdesc a.hover_ {
background: #ccc;
}
</style>
<div class="subdesc">
<a href="https://goodjobpt.com/hosp" target="_self" class="hover_"> 병원 </a>
<a href="https://goodjobpt.com/bbs/inst.php" target="_self"> 교육 </a>
<a href="https://goodjobpt.com/bbs/prac.php" target="_self"> 실습 </a>
<a href="https://goodjobpt.com/bbs/univ.php" target="_self"> 대학 </a>
</div>
<br><br>
<div class="subdesc">
<span><font size="5px"><b>물리치료사 전·현직자들의 병원 리뷰</b></font></span>
</div>
답변을 작성하시기 전에 로그인 해주세요.