I want to make an table that have two header and two data in one cell using Ant Table .
I have a template like this.
<template>
<a-table :columns="columns" :data-source="data">
//some props
</a-table>
<template>
And script like this.
columns: [
{ title:'Name', dataIndex:'name', key:'name' },
{ title:'Age', dataIndex:'age', key:'age' },
{ title:'Gender', dataIndex: 'gender', key: 'gender' }
],
data: [
{
name: 'John Brown',
age: 32,
address: 'Male',
},
{
name: 'Jindel Rose',
age: 40,
address: 'Female',
},
]
For now, I already have a two data in one cell using SlotScope. But my problem is the header.
I cannot break the text of my header and already try some basic attempts like
columns: [
{ title:'Name', dataIndex:'name', key:'name' },
{ title:'Age' + <br/> + 'Gender', dataIndex:'ageGender', key:'ageGender' }
],
Orr some rendering inside my title but i get a lots of error.
How can i achieve the two header in once cell that will looks like below image?

You have errors because Vuejs can't parse HTML in the script. So, in this case is better to do it in the template.
By looking at the documentation, I realised that you can solve this by using a key and an
v-ifin the template.What this means is that when the table is been constructed by the Ant Design it will loop through all the columns, and when it sees a column with the specified key it will access the conditional statement and apply the custom template.
Example
And then you can have a custom style for that class, which I named
bottom-border