PHP Classes

Bootstrap Table Generator: Generate HTML table using Bootstrap styles

Recommend this page to a friend!
  Info   View files Example   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum (3)   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 488 This week: 1All time: 5,890 This week: 560Up
Version License PHP version Categories
bootstrap-table 1.1GNU General Publi...5.3HTML, PHP 5
Description 

Author

This class can generate HTML table using Bootstrap CSS styles.

It provides a fluent interface to compose the definition of a table, with data for the column headers and row data.

The class can also set the table CSS styles to have properties set to bordered, striped, responsive, condensed and hover that map to Bootstrap styles.

The class returns the composed table as a single string assembling the table rows and columns with the defined Bootstrap styles.

Picture of Pak Xpertz
  Performance   Level  
Name: Pak Xpertz <contact>
Classes: 2 packages by
Country: Pakistan Pakistan
Age: ???
All time rank: 241332 in Pakistan Pakistan
Week rank: 416 Up8 in Pakistan Pakistan Up

Example

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
        <title>Bootstrap Table helper Example</title>

        <!-- Bootstrap -->
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">

        <!--[if lt IE 9]>
          <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
          <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
        <![endif]-->
    </head>
    <body>
        <div class="container-fluid">
            <div class="row">
                <div class="col-xs-8 col-xs-offset-2">
                    <?php
                   
require 'class.BootstrapTable.php';
                   
$table = new BootstrapTableHelper();
                    echo
$table->bordered()
                            ->
striped()
                            ->
hover()
                            ->
columns(array("Languages","IDEs","Browsers","OSs"))
                            ->
addRow(array("PHP","NetBeans","FireFox","Windows"))
                            ->
addRow(array("PHP","NetBeans","FireFox","Windows"))
                            ->
addRow(array("PHP","NetBeans","FireFox","Windows"))
                            ->
addRow(array("PHP","NetBeans","FireFox","Windows"))
                            ->
addRow(array("Java","Visual Studio","Chrome","Linux"))
                            ->
addRow(array("Java","Visual Studio","Chrome","Linux"))
                            ->
addRow(array("Java","Visual Studio","Chrome","Linux"))
                            ->
addRow(array("Java","Visual Studio","Chrome","Linux"))
                            ->
addRow(array("C++","Ecllips","Internet Explorer","Mac OS"))
                            ->
addRow(array("C++","Ecllips","Internet Explorer","Mac OS"))
                            ->
addRow(array("C++","Ecllips","Internet Explorer","Mac OS"))
                            ->
addRow(array("C++","Ecllips","Internet Explorer","Mac OS"))
                            ->
make();
                   
?>
</div>
            </div>
        </div>

        <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
        <!-- Include all compiled plugins (below), or include individual files as needed -->
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
    </body>
</html>


  Files folder image Files  
File Role Description
Accessible without login Plain text file example.php Example How to use the class
Plain text file class.BootstrapTable.php Class Helper Class

 Version Control Unique User Downloads Download Rankings  
 0%
Total:488
This week:1
All time:5,890
This week:560Up
User Comments (3)