Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I don't have border on react-bootstrap-table-next

I use react-bootstrap-table-next in this way:

import React, { Component } from 'react';
import products from './data.js';
import 'react-bootstrap-table-next/dist/react-bootstrap-table2.min.css';
import BootstrapTable from 'react-bootstrap-table-next';

const columns = [{
  dataField: 'id',
  text: 'Product ID'
}, {
  dataField: 'name',
  text: 'Product Name'
}, {
  dataField: 'price',
  text: 'Product Price'
}];

class App extends Component {
  render() {
    return (
      <BootstrapTable keyField='id' data={ products } columns={ columns } />
    );
  }
}

export default App;

But, there is no border.

enter image description here

What I'm missing?

like image 496
tesicg Avatar asked Mar 06 '23 20:03

tesicg


1 Answers

I had the exact same issue. It requires bootstrap CSS like others mentioned. In a typical react app, you'll want to install bootstrap via npm and then import the bootstrap CSS with this line.

import 'bootstrap/dist/css/bootstrap.min.css';
like image 103
Zip184 Avatar answered Mar 11 '23 22:03

Zip184