테스트 사이트 - 개발 중인 베타 버전입니다

간단한듯 한데 잘 안되는 테이블 문제 입니다. 채택완료

천년늑대 5년 전 조회 3,463

<table border="0" cellspacing="1" cellpadding="0" bgcolor='blue'>
    <tr>
        <td width="600" height="50" valign='top'>
            <table border="0" cellspacing="0" cellpadding="0" bgcolor='ffffff'>
                <tr>
                    <td width="200" height="100" valign='top'>1</td>
                    <td width="200" height="100" valign='top'>1</td>
                    <td width="200" height="100" valign='top'>1</td>
                </tr>
                <tr>
                    <td width="200" height="100" valign='top'>1</td>
                    <td width="200" height="100" valign='top'>1</td>
                    <td width="200" height="100" valign='top'>1</td>
                </tr>
            </table>        
        </td>
    </tr>
</table>

첫번째 테이블에서 배경색을 파란색으로 하고 두번째 테이블에서 배경색을 흰색으로 해서 파란색선들을 만들려고 합니다.

문제는 <td> 부분에  bgcolor='ffffff' 를 넣지 않고 파란색선들을 만들어야 하는데 이게 잘 안되네요.

실선은 파란색 <td>부분 배경색은 흰색 이어야 합니다.

방법이 없을까요??

댓글을 작성하려면 로그인이 필요합니다.

답변 5개

채택된 답변
+20 포인트

 

</p>

<p>  <table border="0" cellspacing="0" cellpadding="0" bgcolor='blue'>

    <tr>

        <td width="600" height="50" valign='top'>

            <table border="0" cellspacing="1" cellpadding="0">

                <tr bgcolor='ffffff'>

                    <td width="200" height="100" valign='top'>1</td>

                    <td width="200" height="100" valign='top'>1</td>

                    <td width="200" height="100" valign='top'>1</td>

                </tr>

                <tr bgcolor='ffffff'>

                    <td width="200" height="100" valign='top'>1</td>

                    <td width="200" height="100" valign='top'>1</td>

                    <td width="200" height="100" valign='top'>1</td>

                </tr>

            </table>        

        </td>

    </tr>

</table></p>

<p>

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

답변 주신분들 모두 감사합니다..

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

5년 전

<style>
  table {
    width: 100%;
    border: 1px solid #444444;
    border-collapse: collapse;
  }
  th, td {
    padding: 10px;
  }
</style>

    <table>
      <tbody>
        <tr bgcolor="#0000FF">
          <td style=" border: 1px solid #fff">1</td><td style=" border: 1px solid #fff">1</td><td style=" border: 1px solid #fff">1</td>
        </tr>
        <tr>
          <td style=" border: 1px solid #0000FF">1</td><td style=" border: 1px solid #0000FF">1</td><td style=" border: 1px solid #0000FF">1</td>
        </tr>
      </tbody>
    </table>
 

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

5년 전

본문의 td 안에 배경색을 넣지 않고는 힘들듯하네요

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

b
5년 전

어떤식으로 마크업할 지 그림이 있나요? table 안에 table 을 넣는건 처음 봐서 왜 이렇게 짜는지 의문이네요.

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인