Skip to content

Commit 588acce

Browse files
committed
center ticks
1 parent c8419ce commit 588acce

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

webpage/src/components/Table.css

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.cellCenter {
2+
text-align: center;
3+
}

webpage/src/components/Table.js

+14-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from "react";
2+
import "./Table.css";
23

34
const join = (array, separator) =>
45
array.reduce((result, child, index) => {
@@ -28,7 +29,8 @@ const symbol = value => {
2829
}
2930
};
3031

31-
const defaultFallback = (options, field) => options[field] || options.default;
32+
const defaultFallback = (options, field) =>
33+
options[field] === undefined ? options.default : options[field];
3234

3335
const tdValue = {
3436
Package: links,
@@ -42,10 +44,20 @@ const thStyles = {
4244
default: {}
4345
};
4446

47+
const tdClasses = {
48+
Package: null,
49+
Version: null,
50+
default: "cellCenter"
51+
};
52+
4553
const CellTd = options => {
4654
const { header, value } = options;
4755
const cellFormatter = defaultFallback(tdValue, header);
48-
return <td>{cellFormatter(value)}</td>;
56+
return (
57+
<td className={defaultFallback(tdClasses, header)}>
58+
{cellFormatter(value)}
59+
</td>
60+
);
4961
};
5062

5163
const CellTh = options => {

0 commit comments

Comments
 (0)