douxinghuai3150 2016-04-06 03:08 采纳率: 0%
浏览 137

如何将一个表左对齐,一个对齐BOOTSTRAP

I have two tables, and I would like to align one to the left and the other to the right - but I am having some trouble.

This is my code:

<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">

<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" integrity="sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r" crossorigin="anonymous">

<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>

<?php

    print
    "<div class='container'>".
        "<table class='table'>".
        "<tr>".
            "<th class='text-left'>Product Shot</th>".
            "<th class='text-center'>Product Description</th>".
            "<th class='text-center'>Quantity</th>".
            "<th class='text-center'>Total</th>".
        "</tr>".
    "</table>";

    print 
        "<tr>".
            "<td><b>Grand total: </b></td>".
            "<td><strong>'TOTAL'</strong></td>".
            "<td>".
                "<a href='#'><button class='btn btn-success'> Checkout</button></a>".  

                "<a href='remove_all_items.php'><button class='btn btn-danger'> Remove </button></a>".  

                "</a>".
            "</td>".
    "</tr>";

?>

Is it even possible to have two tables on the same page where one is on the left and the other is on the right and is responsive and scrolls down?

How do I go about achieving this?

Thanks

  • 写回答

2条回答 默认 最新

  • douhuan6305 2016-08-05 03:23
    关注

    try to make css class with !important code in it

    example:

    txtleft
    {
       text-align:left !important;
    }
    txtryt
    {
       text-align:right !important;
    }
    txtcent
    {
       text-align:center !important;
    }
    

    and try it to put into your classes

    some bootstrap classes are being inherited by the classes of their parent. but by using !important code; it will not be changed by the parent

    Hope it helps...

    评论

报告相同问题?

悬赏问题

  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 yolov8边框坐标
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真