Progress bar in a cell of a table

2

I'm making a calendar and I need to make a progress bar of the elapsed time each day. I set up the calendar using HTML tables.

How can I make this progress bar each day separately?

    
asked by anonymous 29.12.2017 / 19:50

1 answer

1

I've edited the answer completely, now that you've said it's Bootstrap I made this template with a bar for each day, with the original BS classes, it does not include any new CSS, and I think it will suit you. What you need to customize is just an Override of Classes.

See the Snippet below:

<!DOCTYPE html>
<html lang="en">
<head>
  <title>Bootstrap Example</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script><scriptsrc="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>

</head>
<body>

<div class="container">
  <h2>Tabela com Borda</h2>
  <p>A classe .table-bordered coloca a borda na Table</p>            
  <table class="table table-bordered">
    <thead>
      <tr>
        <th colspan="7">
            <h3 class="text-center">MÊS</h3>
        </th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="active">
          <h4 class="text-center">1</h4>
          <div class="progress">
            <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="100"
            aria-valuemin="0" aria-valuemax="100" style="width:100%">
              100% Complete (success)
            </div>
          </div>
        </td>
        <td>
          <h4 class="text-center">2</h4>
          <div class="progress">
            <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="100"
            aria-valuemin="0" aria-valuemax="100" style="width:100%">
              100% Complete (success)
            </div>
          </div>
        </td>
        <td>
          <h4 class="text-center">3</h4>
          <div class="progress">
            <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="100"
            aria-valuemin="0" aria-valuemax="100" style="width:100%">
              100% Complete (success)
            </div>
          </div>
        </td>
        <td>
          <h4 class="text-center">4</h4>
          <div class="progress">
            <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="100"
            aria-valuemin="0" aria-valuemax="100" style="width:100%">
              100% Complete (success)
            </div>
          </div>
        </td>
        <td>
          <h4 class="text-center">5</h4>
          <div class="progress">
            <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="100"
            aria-valuemin="0" aria-valuemax="100" style="width:100%">
              100% Complete (success)
            </div>
          </div>
        </td>
        <td>
          <h4 class="text-center">6</h4>
          <div class="progress">
            <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="100"
            aria-valuemin="0" aria-valuemax="100" style="width:100%">
              100% Complete (success)
            </div>
          </div>
        </td>
        <td>
          <h4 class="text-center">7</h4>
          <div class="progress">
            <div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="60"
            aria-valuemin="0" aria-valuemax="100" style="width:60%">
              60% Complete (warning)
            </div>
          </div>
        </td>
      </tr>
      <tr>
        <td class="active">
          <h4 class="text-center">8</h4>
          <div class="progress">
            <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width:0%">
            </div>
          </div>
        </td>
        <td>
          <h4 class="text-center">9</h4>
          <div class="progress">
            <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width:0%">
            </div>
          </div>
        </td>
        <td>
          <h4 class="text-center">10</h4>
          <div class="progress">
            <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width:0%">
            </div>
          </div>
        </td>
        <td>
          <h4 class="text-center">11</h4>
          <div class="progress">
            <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width:0%">
            </div>
          </div>
        </td>
        <td>
          <h4 class="text-center">12</h4>
          <div class="progress">
            <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width:0%">
            </div>
          </div>
        </td>
        <td>
          <h4 class="text-center">13</h4>
          <div class="progress">
            <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width:0%">
            </div>
          </div>
        </td>
        <td>
          <h4 class="text-center">14</h4>
          <div class="progress">
            <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width:0%">
            </div>
          </div>
        </td>
      </tr>
      <tr>
        <td class="active">
          <h4 class="text-center">15</h4>
          <div class="progress">
            <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width:0%">
            </div>
          </div>
        </td>
        <td>
          <h4 class="text-center">16</h4>
          <div class="progress">
            <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width:0%">
            </div>
          </div>
        </td>
        <td>
          <h4 class="text-center">17</h4>
          <div class="progress">
            <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width:0%">
            </div>
          </div>
        </td>
        <td>
          <h4 class="text-center">18</h4>
          <div class="progress">
            <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width:0%">
            </div>
          </div>
        </td>
        <td>
          <h4 class="text-center">19</h4>
          <div class="progress">
            <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width:0%">
            </div>
          </div>
        </td>
        <td>
          <h4 class="text-center">20</h4>
          <div class="progress">
            <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width:0%">
            </div>
          </div>
        </td>
        <td>
          <h4 class="text-center">21</h4>
        <div class="progress">
            <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width:0%">
            </div>
          </div>
        </td>
      </tr>
      <tr>
        <td class="active">22</td>
        <td>23</td>
        <td>24</td>
        <td>25</td>
        <td>26</td>
        <td>27</td>
        <td>28</td>
      </tr>
      <tr>
        <td class="active">29</td>
        <td>30</td>
        <td>31</td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
      </tr>
    </tbody>
  </table>
</div>

</body>
</html>

I left the rest of the month for you to finish and see how it was done!

In <div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="60"aria-valuemin="0" aria-valuemax="100" style="width:60%"> you can work with values dynamically to make the bar go full throughout the day.

The text that is inside the bar is optional may or may not have 100% Complete     

29.12.2017 / 20:01