You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
347 B

4 years ago
  1. /**
  2. * @param {table~row[]} rows
  3. * @param {Object} config
  4. * @returns {table~row[]}
  5. */
  6. export default (rows, config) => {
  7. return rows.map((cells) => {
  8. return cells.map((value, index1) => {
  9. const column = config.columns[index1];
  10. return ' '.repeat(column.paddingLeft) + value + ' '.repeat(column.paddingRight);
  11. });
  12. });
  13. };