Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Semantic-UI loader inside <table>

I'm using ajax to update a table's contents, I would like to use the semantic-ui's built-in class "Loader" to show some loading animation at the center of the table while getting the contents but that does not seem to work with <table> tag.

<div class="ui active loader">
  <table class="ui unstackable striped table segment">
    <tr><td>id</td><td>name</td></tr>
    <tr><td>1</td><td>test test</td></tr>
  </table>
</div>

How do I get this to work?

like image 319
PyQL Avatar asked Jan 28 '16 20:01

PyQL


1 Answers

A loader is not meant to contain the thing that's loading. It's used in conjunction with a dimmer.

<link href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.css" rel="stylesheet" />
<div class="dimmable">
  <div class="ui active inverted dimmer">
    <div class="ui loader"></div>
  </div>
  <table class="ui unstackable striped table segment">
    <tr>
      <td>id</td>
      <td>name</td>
    </tr>
    <tr>
      <td>1</td>
      <td>test test</td>
    </tr>
  </table>
</div>

Or it can be standalone if inside a segment

<link href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.css" rel="stylesheet" />
<div class="ui basic segment">
  <div class="ui active loader"></div>
  <table class="ui unstackable striped table segment">
    <tr>
      <td>id</td>
      <td>name</td>
    </tr>
    <tr>
      <td>1</td>
      <td>test test</td>
    </tr>
  </table>
</div>
like image 143
user2867288 Avatar answered Nov 04 '22 09:11

user2867288