I have extended LightningDatatable:
export default class DispatchConsoleDataTable extends LightningDatatable {
static customTypes = {
smartCalendarCell: {
template: calendarCell,
standardCellLayout: false,
typeAttributes: []
}
};
}
using this template:
<template>
<c-dispatch-console-calendar-cell data-navigation="enable" cell-value={value}></c-dispatch-console-calendar-cell>
</template>
and this cell definition:
<template>
<template for:each={cellArray} for:item="cell">
<lightning-layout key={cell.Header} multiple-rows="true">
<template if:true={cell.IsPM}>
<lightning-layout-item size="6"></lightning-layout-item>
</template>
<lightning-layout-item size={cell.Size}>
<lightning-formatted-text class={cell.Class} value={cell.Header}></lightning-formatted-text>
</lightning-layout-item>
<template if:true={cell.IsAM}>
<lightning-layout-item size="6"></lightning-layout-item>
</template>
<template if:true={cell.HasFromTo}>
<template if:true={cell.IsPM}>
<lightning-layout-item size="6"></lightning-layout-item>
</template>
<lightning-layout-item size={cell.Size}>
<lightning-formatted-text class={cell.Class} value={cell.FromTo}></lightning-formatted-text>
</lightning-layout-item>
<template if:true={cell.IsAM}>
<lightning-layout-item size="6"></lightning-layout-item>
</template>
</template>
</lightning-layout>
</template>
</template>
Everything is working fine except I would like to override the default vertical alignment of the cells, which seems to be center alignment:
Question: How do I change the vertical alignment for my custom cells to be "top"?
Thanks.
<lightning-layout vertical-align="start"
to your cell definition?