<template>
  <thead class="ivu-table-header">
    <tr>
      <th v-for="(col, index) in columns" :key="col.key || index" :style="headerStyle(col)">
        <div class="ivu-table-cell">
          <span>{{ col.title }}</span>
        </div>
      </th>
    </tr>
  </thead>
</template>

<script>
export default {
  name: 'SubThead',
  props: {
    columns: {
      type: Array,
      default: () => []
    }
  },
  methods: {
    headerStyle(col) {
      const align = col && col.align ? col.align : 'center'
      return { textAlign: align }
    }
  }
}
</script>


