알쓸전컴(알아두면 쓸모있는 전자 컴퓨터)

bootstrap [CSS] 정렬 클래스 변형 클래스 테이블 본문

Web /bootstrap

bootstrap [CSS] 정렬 클래스 변형 클래스 테이블

백곳 2017. 9. 7. 19:54

지금 부터 부트 스트랩 코드는 기본 코드는 기본 코드  를 바탕으로 body 만 작성 하겠습니다. 


정렬 클래스 



<p class="text-left">좌측정렬된 텍스트.</p>

<p class="text-center">중앙정렬된 텍스트.</p>

<p class="text-right">우측정렬된 텍스트.</p>

<p class="text-justify">양쪽정렬된 텍스트.</p>

<p class="text-nowrap">그냥 텍스트.</p>


변형 클래스

<p class="text-lowercase">Lowercased text.</p>

<p class="text-uppercase">Uppercased text.</p>

<p class="text-capitalize">Capitalized text.</p>


기본 테이블


<table class="table">

      <caption>Optional table caption.</caption>

      <thead>

        <tr>

          <th>#</th>

          <th>First Name</th>

          <th>Last Name</th>

          <th>Username</th>

        </tr>

      </thead>

      <tbody>

        <tr>

          <th scope="row">1</th>

          <td>Mark</td>

          <td>Otto</td>

          <td>@mdo</td>

        </tr>

        <tr>

          <th scope="row">2</th>

          <td>Jacob</td>

          <td>Thornton</td>

          <td>@fat</td>

        </tr>

        <tr>

          <th scope="row">3</th>

          <td>Larry</td>

          <td>the Bird</td>

          <td>@twitter</td>

        </tr>

      </tbody>

    </table>


줄무늬 테이블 


   <table class="table table-striped">

      <caption>Optional table caption.</caption>

      <thead>

        <tr>

          <th>#</th>

          <th>First Name</th>

          <th>Last Name</th>

          <th>Username</th>

        </tr>

      </thead>

      <tbody>

        <tr>

          <th scope="row">1</th>

          <td>Mark</td>

          <td>Otto</td>

          <td>@mdo</td>

        </tr>

        <tr>

          <th scope="row">2</th>

          <td>Jacob</td>

          <td>Thornton</td>

          <td>@fat</td>

        </tr>

        <tr>

          <th scope="row">3</th>

          <td>Larry</td>

          <td>the Bird</td>

          <td>@twitter</td>

        </tr>

      </tbody>

    </table>


선있는 테이블 

   <table class="table table-bordered">

      <caption>Optional table caption.</caption>

      <thead>

        <tr>

          <th>#</th>

          <th>First Name</th>

          <th>Last Name</th>

          <th>Username</th>

        </tr>

      </thead>

      <tbody>

        <tr>

          <th scope="row">1</th>

          <td>Mark</td>

          <td>Otto</td>

          <td>@mdo</td>

        </tr>

        <tr>

          <th scope="row">2</th>

          <td>Jacob</td>

          <td>Thornton</td>

          <td>@fat</td>

        </tr>

        <tr>

          <th scope="row">3</th>

          <td>Larry</td>

          <td>the Bird</td>

          <td>@twitter</td>

        </tr>

      </tbody>

    </table>


행 hover

  <table class="table table-hover">

      <caption>Optional table caption.</caption>

      <thead>

        <tr>

          <th>#</th>

          <th>First Name</th>

          <th>Last Name</th>

          <th>Username</th>

        </tr>

      </thead>

      <tbody>

        <tr>

          <th scope="row">1</th>

          <td>Mark</td>

          <td>Otto</td>

          <td>@mdo</td>

        </tr>

        <tr>

          <th scope="row">2</th>

          <td>Jacob</td>

          <td>Thornton</td>

          <td>@fat</td>

        </tr>

        <tr>

          <th scope="row">3</th>

          <td>Larry</td>

          <td>the Bird</td>

          <td>@twitter</td>

        </tr>

      </tbody>

    </table>


테이블 맥락적인 요소로 사용할 클래스 


클래스설명
.active특정한 행이나 셀에 hover 했을 때와 같은 색을 입힙니다.
.success성공적이거나 긍정적인 액션을 의미합니다.
.info중립적인 정보의 변화나 액션을 의미합니다.
.warning주의가 필요한 경고를 의미합니다.
.danger위험하거나 부정적일수 있는 액션을 의미합니다.


<table class="table">

      <thead>

        <tr>

          <th>#</th>

          <th>Column heading</th>

          <th>Column heading</th>

          <th>Column heading</th>

        </tr>

      </thead>

      <tbody>

        <tr class="active">

          <th scope="row">1</th>

          <td>Column content</td>

          <td>Column content</td>

          <td>Column content</td>

        </tr>

        <tr>

          <th scope="row">2</th>

          <td>Column content</td>

          <td>Column content</td>

          <td>Column content</td>

        </tr>

        <tr class="success">

          <th scope="row">3</th>

          <td>Column content</td>

          <td>Column content</td>

          <td>Column content</td>

        </tr>

        <tr>

          <th scope="row">4</th>

          <td>Column content</td>

          <td>Column content</td>

          <td>Column content</td>

        </tr>

        <tr class="info">

          <th scope="row">5</th>

          <td>Column content</td>

          <td>Column content</td>

          <td>Column content</td>

        </tr>

        <tr>

          <th scope="row">6</th>

          <td>Column content</td>

          <td>Column content</td>

          <td>Column content</td>

        </tr>

        <tr class="warning">

          <th scope="row">7</th>

          <td>Column content</td>

          <td>Column content</td>

          <td>Column content</td>

        </tr>

        <tr>

          <th scope="row">8</th>

          <td>Column content</td>

          <td>Column content</td>

          <td>Column content</td>

        </tr>

        <tr class="danger">

          <th scope="row">9</th>

          <td>Column content</td>

          <td>Column content</td>

          <td>Column content</td>

        </tr>

      </tbody>

    </table>


반응형 테이블

 작은 기기에서는 수평 스크롤을 할 수 있는 반응형 테이블을 만듭니다(768px 이하). 768px 보다 큰 기기에서는 보기에 차이가 없습니다.

table-responsive 로 감싸줍니다.


  <div class="table-responsive">

      <table class="table">

        <thead>

          <tr>

            <th>#</th>

            <th>Table heading</th>

            <th>Table heading</th>

            <th>Table heading</th>

            <th>Table heading</th>

            <th>Table heading</th>

            <th>Table heading</th>

          </tr>

        </thead>

        <tbody>

          <tr>

            <th scope="row">1</th>

            <td>Table cell</td>

            <td>Table cell</td>

            <td>Table cell</td>

            <td>Table cell</td>

            <td>Table cell</td>

            <td>Table cell</td>

          </tr>

          <tr>

            <th scope="row">2</th>

            <td>Table cell</td>

            <td>Table cell</td>

            <td>Table cell</td>

            <td>Table cell</td>

            <td>Table cell</td>

            <td>Table cell</td>

          </tr>

          <tr>

            <th scope="row">3</th>

            <td>Table cell</td>

            <td>Table cell</td>

            <td>Table cell</td>

            <td>Table cell</td>

            <td>Table cell</td>

            <td>Table cell</td>

          </tr>

        </tbody>

      </table>

    </div><!-- /.table-responsive -->

'Web > bootstrap ' 카테고리의 다른 글

bootstrap [CSS]폼  (0) 2017.09.08
bootstrap [CSS] 그리드 시스템  (0) 2017.09.06
bootstrap 기본 코드 작성하기  (0) 2017.09.02
bootstrap 이란 ?  (0) 2017.09.02
Comments