S
S
SanDisk2019-10-13 23:45:21
css
SanDisk, 2019-10-13 23:45:21

How to implement such rating on Bootstrap?

How to implement such rating (or something similar) on Bootstrap?
5da38ccf28603012375462.jpeg

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
pbozov, 2019-10-14
@pbozov

Is this a bootstrap task?

$( ".raiting" ).each(function(  ) {
  var raiting = $( this ).data( "raiting" );
 // тут сделать проверку и append иконок
});

https://fontawesome.com/icons/star?style=solid
https://fontawesome.com/icons/star-half-alt?style=solid
https://fontawesome.com/icons/star?style=regular

G
Gleb Varganov, 2019-10-14
@kores

Bootstrap is not required at all.
You set an array (you set only 2 lines, you do it further by analogy):

$bukmeker_arr = array(
  array(
  'pic' => 'winline.jpg',
  'stars' => 5,
  'action' => 'фрибет до 1000 руб.',
  'obzor_link' => 'https://site.ru/winline/review/',
  'bet_link' => 'https://winline.bet/',
  ),
  array(
  'pic' => 'fonbet.jpg',
  'stars' => 4,
  'action' => 'до 10000 руб.',
  'obzor_link' => 'https://site.ru/fonbet/review/',
  'bet_link' => 'https://fonbet.bet/',
  ),
);

Then you iterate over the array and output it as a table:
echo '<table>';
  echo '<thead>';
    echo '<tr>';
      echo '<td> № </td>';
      echo '<td> Картинка </td>';
      echo '<td> Звезды </td>';
      echo '<td> Акция </td>';
      echo '<td> Обзор </td>';
      echo '<td> Сайт </td>';
    echo '</tr>';	
  echo '</thead>';
  echo '<tbody>';
  $i = 0;
  foreach($bukmeker_arr as $bukmeker) {
    $i++;
    echo '<tr>';
      echo '<td>#'.$i.'</td>';
      echo '<td><img src="'.$bukmeker['pic'].'" alt="" title="" /></td>';
      echo '<td><img src="star_'.$bukmeker['pic'].'.jpg" alt="" title="" /></td>';
      echo '<td>'.$bukmeker['action'].'</td>';
      echo '<td><a href="'.$bukmeker['obzor_link'].'">обзор</a></td>';
      echo '<td><a href="'.$bukmeker['bet_link'].'">сайт</a></td>';
    echo '</tr>';
  }
  echo '</tbody>';
echo '</table>';

It remains only to add styling through CSS styles for your table. Everything is very simple...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question