skip to Main Content

I want to insert a table HTML on my post.

<div class="page-section">
    <div class="container">
        <div class="row">
            <div class="col-md-1"></div>
            <div class="col-md-10">
                {!! $post->body !!}
            </div>
            <div class="col-md-1"></div>
        </div>
    </div>
</div>

CSS for .page-section:

.page-section {
    display: block;
    position: relative;
    overflow: hidden;
}

The code of table:

li {
  list-style: none;
}
/* ------------ pricing table -------------- */

#pricing-table-section .pricing-table {
    border: none;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    -webkit-transition: all 400ms linear;
    transition: all 400ms linear;
    padding: 32px 21px;
    border-radius: 8px;
    background: #f5f5f5;
}

#pricing-table-section .pricing-table h4 {
    color: #74a534;
    font-family: "Roboto", sans-serif;
    margin-bottom: 25px;
}

#pricing-table-section .pricing-table .price {
    padding: 22px 0;
    border-top: 1px solid #e1f1ff;
    /* border-bottom: 1px solid #d9d9d9; */
}

#pricing-table-section .pricing-table .price h2 {
    margin-left: 20px;
    position: relative;
    font-family: 'Open Sans', sans-serif;
    color: #000000;
}

#pricing-table-section .pricing-table .price h2 span {
    font-family: "Roboto", sans-serif;
}

#pricing-table-section .pricing-table .price h2 .dollar {
    font-size: 18px;
    display: inline-block;
    position: absolute;
    /* left: -20px; */
    top: 10px;
}

#pricing-table-section .pricing-table .price h2 .month {
    font-size: 10px;
    display: inline-block;
    position: absolute;
    left: 9px;
    bottom: -4px;
    color: #929292;
}

@media screen and (max-width: 992px) {
    #pricing-table-section .pricing-table .price h2 {
        margin-left: 10px;
    }
}

#pricing-table-section .pricing-table .price p {
    color: #929292;
}

#pricing-table-section .pricing-table ul.packages {
    padding: 20px 0;
}

#pricing-table-section .pricing-table ul.packages li {
    font-size: 16px;
    font-weight: 400;
    font-family: "Open Sans", sans-serif;
    line-height: 40px;
}

#pricing-table-section .pricing-table ul.packages li i {
    display: inline-block;
    width: 24px;
    color: #62be10;
}

#pricing-table-section .pricing-table .button {
    background: #07aaa5;
    color: #ffffff;
    border-color: transparent;
}


/* #pricing-table-section .pricing-table .button:before {
    background: #74a534;
} */

#pricing-table-section .pricing-table.black {
    background: #07aaa5;
    color: #ffffff;
    border-color: transparent;
}

#pricing-table-section .pricing-table.black ul.packages li i,
#pricing-table-section .pricing-table.kinhdoanh ul.packages li i,
#pricing-table-section .pricing-table.coban ul.packages li i {
    color: #ffffff;
}

#pricing-table-section .pricing-table.black h4,
#pricing-table-section .pricing-table.black h2,
#pricing-table-section .pricing-table.black p,
#pricing-table-section .pricing-table.black h2>.month {
    color: #ffffff;
}

#pricing-table-section .pricing-table.black .button {
    background: #ffffff;
    color: #202125;
}

#pricing-table-section .pricing-table.black .button:before {
    background: #74a534;
}

#pricing-table-section .pricing-table.black .button:hover,
#pricing-table-section .pricing-table.black .button:focus,
#pricing-table-section .pricing-table.black .button:active {
    color: #ffffff;
}

@media screen and (max-width: 767px) {
    #pricing-table-section .pricing-table.black {
        margin: 50px 0;
    }
}

#pricing-table-section .pricing-table.black:hover .button:before,
#pricing-table-section .pricing-table.coban:hover .button:before,
#pricing-table-section .pricing-table.kinhdoanh:hover .button:before {
    background: #202125;
}

#pricing-table-section .pricing-table:hover .button:hover {
    color: #ffffff;
}


/* ------------ pricing table  end -------------- */
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div id="pricing-table-section" class="mid-level-padding">
    <div class="container">
        <div class="row">
            <div class="col-xs-12 text-center ">
                <div class="section-top-heading">
                    <h2 class="head-content">Bảng giá</h2>
                    <p>Tùy theo nhu cầu của bạn và chọn gói tốt nhất cho mình.</p>
                </div>
            </div>

        </div>
        <div class="row">
            <div style="margin-bottom:10px;" class="col-lg-4 col-md-4 col-sm-6 col-xs-12 wow fadeInLeft animated" style="visibility: visible;">
                <div class="pricing-table coban">
                    <div class="type">
                        <h4>Gói cơ bản</h4>
                    </div>
                    <div class="price">
                        <div class="row">
                            <div class="col-xs-12">
                                <h2>2.200.000 <span class="dollar">VNĐ</span></h2>
                                <span style="margin-left: 20px;">Thiết kế web theo mẫu sẵn có</span>
                            </div>
                        </div>
                    </div>
                    <div class="underline1 normal no-margin"></div>
                    <div class="underline2 normal no-margin"></div>
                    <ul class="packages">
                        <li><i class="fa fa-check" aria-hidden="true"></i>Chọn mẫu giao diện</li>
                        <li><i class="fa fa-check" aria-hidden="true"></i><strong>Miễn phí</strong> 1 hosting + tên miền</li>
                        <li><i class="fa fa-check" aria-hidden="true"></i>Hỗ trợ 24/7</li>
                        <li><i class="fa fa-check" aria-hidden="true"></i>Bảo hành vĩnh viễn</li>
                        <li><i class="fa fa-check" aria-hidden="true"></i>Chức năng đặt hàng, thanh toán</li>
                    </ul>
                    <button class="btn button btn-block"><a href="/goi-co-ban"> Xem Mẫu Web </a></button>
                </div>
            </div>
            <div style="margin-bottom:10px;" class="col-lg-4 col-md-4 col-sm-6 col-xs-12 wow fadeInUp animated" data-wow-duration="3s" style="visibility: visible; animation-duration: 3s;">
                <div class="pricing-table black">
                    <div class="type">
                        <h4>Gói theo yêu cầu</h4>
                    </div>
                    <div class="price">
                        <div class="row">
                            <div class="col-xs-12">
                                <h2>3.500.000+ <span class="dollar">VNĐ</span></h2>
                                <span style="margin-left: 20px;">Web giới thiệu công ty, sản phẩm.</span>
                            </div>
                        </div>
                    </div>
                    <div class="underline1 normal no-margin"></div>
                    <div class="underline2 normal no-margin"></div>
                    <ul class="packages">
                        <li><i class="fa fa-check" aria-hidden="true"></i><strong>Thiết kế web theo yêu cầu</strong></li>
                        <li><i class="fa fa-check" aria-hidden="true"></i><strong>Miễn phí</strong> 1 hosting + tên miền</li>
                        <li><i class="fa fa-check" aria-hidden="true"></i>Hỗ trợ 24/7</li>
                        <li><i class="fa fa-check" aria-hidden="true"></i>Bảo hành vĩnh viễn</li>
                        <li><i class="fa fa-times" aria-hidden="true"></i>Không hỗ trợ đặt hàng, thanh toán</li>
                    </ul>
                    <button onclick="location.href='http://127.0.0.1:8000/#contact-us'" class="btn button btn-block">Đăng ký</button>
                </div>
            </div>
            <div style="margin-bottom:10px;" class="col-lg-4 col-md-4 col-sm-6 col-xs-12 col-md-offset-0 col-lg-offset-0 col-xs-offset-0 col-sm-offset-3 wow fadeInRight animated" style="visibility: visible;">
                <div class="pricing-table kinhdoanh">
                    <div class="type">
                        <h4>Gói kinh doanh</h4>
                    </div>
                    <div class="price">
                        <div class="row">
                            <div class="col-xs-12">
                                <h2>4.200.000+ <span class="dollar">VNĐ</span></h2>
                                <span style="margin-left: 20px;">Website bán hàng.</span>
                            </div>
                        </div>
                    </div>
                    <div class="underline1 normal no-margin"></div>
                    <div class="underline2 normal no-margin"></div>
                    <ul class="packages">
                        <li><i class="fa fa-check" aria-hidden="true"></i><strong>Thiết kế web theo yêu cầu</strong></li>
                        <li><i class="fa fa-check" aria-hidden="true"></i><strong>Miễn phí</strong> 1 hosting + tên miền</li>
                        <li><i class="fa fa-check" aria-hidden="true"></i>Hỗ trợ 24/7</li>
                        <li><i class="fa fa-check" aria-hidden="true"></i>Bảo hành vĩnh viễn</li>
                        <li><i class="fa fa-check" aria-hidden="true"></i><strong>Chức năng đặt hàng, thanh toán</strong></li>
                    </ul>
                    <button class="btn button btn-block">Đăng ký</button>
                </div>
            </div>
        </div>

    </div>
</div>
<!--pricing table end -->

On $post->body contain this table HTML.

I want the table HTML should be at the center page.

But it have position inside .page-section .container.

I can add class and style in the table HTML. Have any method to change position this table doesn’t depend on parent div?

Current my table HTML looks like:

Explain:

On text, you can see dimension is equal.

I want the HTML table should have dimension also equal.

But the HTML table inside div contains text.

2

Answers


  1. From the screen capture you are sharing it seems that the table is overflowing the container.

    You can try to add a width and a table-layout: fixed, like that:

    #pricing-table-section .pricing-table {
        border: none;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
        -webkit-transition: all 400ms linear;
        transition: all 400ms linear;
        padding: 32px 21px;
        border-radius: 8px;
        background: #f5f5f5;
    
        table-layout: fixed; 
        width: 100%
    }
    
    Login or Signup to reply.
  2. Remove div.container inside your table #pricing-table-section. It will be fixed.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search