html - 无法使用 Bootstrap 在页面上放置表格列

标签 html css web twitter-bootstrap-3

table doesn't fit on the screen. tried with most of the combination but doesn't work. amateur, help needed.

我不知道出了什么问题,也许是一些愚蠢的错误,而且找不到任何错误

  <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Generate</title>

        <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
    </head>
    <body>

    <nav class="navbar navbar-inverse">
        <div class="container-fluid">
            <div class="navbar-header"  >
                <a class="navbar-brand" href="index.html"> <img alt="Brand" src="slideshow/img.png" style="height: 40px; display: inline-block; margin-top: -5px"> </a>
            </div>
            <ul class="nav navbar-nav" >
                <li class="active"><a href="index.html">Home</a></li>
                <li><a href="about.html">Generate POR</a></li>
                <li><a href="Update\Adminlogin.html">Update POR</a></li>
                <li><a href="video.html">Help</a></li>
                <li><a href="contact.html">Contact us</a></li>

            </ul>

            <form class="navbar-form navbar-right">
                <div class="form-group" id="demo">
                    <input type="text" class="form-control" placeholder="Search">
                </div>
                <button type="submit" class="btn btn-default">Submit</button>
            </form>

            <form class="navbar-form navbar-right">
                <div class="form-group" id="txt1" style="color: aliceblue; margin-top: -5px"  >

                </div>
            </form>

        </div>
    </nav>

        <div class="col-md-8 col-md-offset-2">
            <div class="row">
                <form>
                    <div class="col-sm-12">
                        <div class="row">
                            <div class="col-sm-6 form-group">
                                <label>P O Date</label>
                                <input type="date" class="form-control">
                            </div>
                            <div class="col-sm-6 form-group">
                                <label>Category</label>
                                <select class="form-control" >
                                    <option>Technology</option>
                                    <option>Business</option>
                                    <option>Development</option>
                                    <option>Process</option>
                                </select>
                            </div>
                        </div>
                    </div>

                    <div class="col-sm-12">
                        <div class="row">
                            <div class="col-sm-6 form-group">
                                <label>Location</label>
                                <select class="form-control" >
                                    <option>Bengaluru</option>
                                    <option>Mumbai</option>
                                    <option>Pune</option>
                                </select>
                            </div>
                            <div class="col-sm-3 form-group">
                                <label>Type of training</label>
                                <select class="form-control" >
                                    <option>RBI</option>
                                    <option>PST</option>
                                    <option>Org needs</option>
                                </select>
                            </div>
                            <div class="col-sm-3 form-group">
                                <label>Venue Details</label>
                                <select class="form-control" >
                                    <option>Mumbai</option>
                                    <option>Bengluru</option>
                                    <option>Pune</option>
                                </select>
                            </div>
                        </div>
                    </div>

                    <div class="col-sm-12">
                        <div class="row">
                            <div class="col-sm-6 form-group">
                                <div class="form-group">
                                    <label>Vendor Address</label>
                                    <textarea placeholder="Vendor Address Here.." rows="3" class="form-control"></textarea>
                                </div>
                            </div>

                            <div class="col-sm-6 form-group">
                                <div class="form-group">
                                    <label>Billing Address</label>
                                    <br>
                                        Billing Address :<br>
                                        Quinnox Consultancy Services Ltd.;<br>
                                        Unit 170,SDF VI, SEEPZ SEZ,<br>
                                        Andheri(East), Mumbai-400096<br>

                                </div>
                            </div>
                        </div>
                    </div>

Display of tables isnt good below part is the problemtable doest fit on the screen

                            <div class="col-sm-12">
                                <div class="row">
                                    <table class="table table-condensed table-striped  table-hover" align="center">
                                        <thead class="thead-inverse">
                                             <tr>
                                               <div class="form-group">

                                                    <th>Subject</th>
                                                    <th>Faculty</th>
                                                    <th colspan="2" align="center">Date</th>
                                                    <th>Days</th>
                                                    <th>Batch Size</th>
                                                    <th>Rate per day</th>
                                                    <th>Approx Expected value(INR)</th>
                                                </div>
                                             </tr>
                                        </thead>

                                        <tbody>
                                            <tr>
                                                <div class="form-group">
                                                    <td><input type="text"/></td>
                                                    <td><input type="text"/></td>
                                                    <td><input type="date"/></td>
                                                    <td><input type="date"/></td>
                                                    <td><input type="text"/></td>
                                                    <td><input type="text"/></td>
                                                    <td><input type="text"/></td>
                                                    <td><input type="text"/></td>
                                                </div>
                                          </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>




                </form>
            </div>
        </div>

    </body>
    </html>

最佳答案

你需要用table-responsive类将表格包裹在div中,不要直接将它包裹到row

here is demo

关于html - 无法使用 Bootstrap 在页面上放置表格列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40872689/

相关文章:

javascript - 视频 'autoplay' 仅有时成功

jquery - 从图像包装器中显示 Bootstrap 轮播标题

javascript - 删除表中的特定列

php - PHP获取URL中 "/"后的参数

jquery - 从顶部或底部悬停时,Bootstrap 悬停下拉菜单不起作用 "onhover"

javascript - 操作内存中 jQuery 对象的 textarea 值

html - 用于简单 html 页面的 WYSIWYG mathEditor

java - 网站互动

html - 当我从另一个链接页面单击返回时,我的页面设计会更改颜色/大小

html - 具有奇怪颜色行为的链接的 CSS 表格