I am trying to left-align cell values in my FixedDataTable implementation. Below is the code I am using:
require('./app.css');
require('fixed-data-table/dist/fixed-data-table.min.css');
const $ = require('jquery');
const React = require('react');
import {Table, Column, Cell} from 'fixed-data-table';
const App = React.createClass({
render: function() {
return (
<Table
height = {200} width = {200}
rowsCount = { 10} rowHeight = { 26}
headerHeight = {100}>
<Column
width={100}
cell={props=>(<Cell className='align-right'>{props.rowIndex}</Cell>)}
align='left'
header="Right-aligned values"/>
<Column
width={100}
cell={props=>(<Cell className='align-left'>{2*props.rowIndex}</Cell>)}
align='left'
header="Left-aligned values"/>
</Table>
);
}
});
export default App;
And the css file I require
is simply:
.align-right {
align: right;
text-align: right;
font-weight: bold;
}
.align-left {
align: left;
text-align: left;
font-style: italic;
}
What I get is the following:
... which demonstrates that the styles are indeed applied, except for the alignment part.
Inspecting the various elements (of type div
mostly) that FixedDataTable
creates in the DOM it appears that my class is assigned at a level too deep to matter (the enclosing div is already left-aligned).