question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

table missing style, css

See original GitHub issue

I am learning react, new bee , trying bootstrap table, table renders, but without any style , I am missing something, my table class src below , I included css using [import 'react-bootstrap-table/dist/react-bootstrap-table-all.min.css'] not sure if this is write?, this project is in github, project link

import React from 'react';
import { BootstrapTable, TableHeaderColumn } from 'react-bootstrap-table';
import 'react-bootstrap-table/dist/react-bootstrap-table-all.min.css';

const products = [];

function addProducts(quantity) {
 const startId = products.length;
 for (let i = 0; i < quantity; i++) {
   const id = startId + i;
   products.push({
     id: id,
     name: 'Item name ' + id,
     price: 2100 + i
   });
 }
}

addProducts(70);

export default class DefaultPaginationTable extends React.Component {
 constructor(props) {
   super(props);
 }
 renderShowsTotal(start, to, total) {
   return (
     <p style={ { color: 'blue' } }>
       From { start } to { to }, totals is { total }&nbsp;&nbsp;(its a customize text)
     </p>
   );
}
 render() {

   	const options = {
   		 page: 1,
   		 sizePerPageList: [ {
   	        text: '5', value: 5
   	      }, {
   	        text: '10', value: 10
   	      }, {
   	        text: '20', value: 20
   	      } ]
   	      ,sizePerPage: 5,  // which size per page you want to locate as default
   	      pageStartIndex: 0, // where to start counting the pages
   	      paginationSize: 10,  // the pagination bar size.
   	      prePage: 'Prev', // Previous page button text
   	      nextPage: 'Next', // Next page button text
   	      firstPage: 'First', // First page button text
   	      lastPage: 'Last', // Last page button text
   	      paginationShowsTotal: this.renderShowsTotal

   	};
   return (
     <div>
       <BootstrapTable data={ products } pagination={ true } options={options} >
         <TableHeaderColumn dataField='id' isKey={ true }>Product ID</TableHeaderColumn>
         <TableHeaderColumn dataField='name'>Product Name</TableHeaderColumn>
         <TableHeaderColumn dataField='price'>Product Price</TableHeaderColumn>
     </BootstrapTable>
     </div>
   );
 }
}`

image of rendered table rbdt

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:15 (5 by maintainers)

github_iconTop GitHub Comments

7reactions
fachhochcommented, Nov 23, 2016

applying jquery and bootstrap script and link tag resolved the issue.

    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
    <script src="http://code.jquery.com/jquery-2.1.3.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
0reactions
athina635commented, Jun 2, 2020

@AllenFang

however Adding the CDN (as show below) to my index.html makes the styling applied to the table but screwing up my all other stylings. Is there a fix so that i don’t have to add this bootstrap link and still it works with just above two imports . Please help me in this regard.

Any solution for this ? the bootstrap.min.css destroy the old page design when import it into he index.html

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to remove all inherited CSS formatting for a table?
Try this. From Eric Meyer's Reset CSS table, caption, tbody, tfoot, thead, tr, th, td { margin: 0; padding: 0; border: 0; outline:...
Read more >
Styling tables - Learn web development | MDN
This article provides a guide to making HTML tables look good, with some specific table styling techniques highlighted. Prerequisites: HTML ...
Read more >
How To Style a Table with CSS | DigitalOcean
The first half of this tutorial will focus on a common table layout that mostly uses the browser's default styles for table elements....
Read more >
Markdown tables missing CSS style · Issue #8097 - GitHub
I'm guessing your issue is that it is un-styled. Adding class="table" to the table element turns it into this: image. Is that what...
Read more >
Missing style.css stylesheet error - 17th Avenue Support Desk
Missing style.css stylesheet error. This error will occur if you upload the incorrect theme file onto your Themes page.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found