DataTable - Filter Filtering is enabled by setting the filter property as true in column object. Default match mode is "startsWith" and this can be configured using filterMatchMode property of column object that also accepts "contains" and "endsWith". An optional global filter feature is available to search all fields with a keyword.
List of Cars

export class DataTableFilterDemo implements OnInit {

    cars: Car[];

    constructor(private carService: CarService) {}

    ngOnInit() {
        this.carService.getCarsMedium().then(cars => this.cars = cars);
    }
}


<div class="ui-widget-header ui-helper-clearfix" style="padding:4px 10px;border-bottom: 0 none">
    <i class="fa fa-search" style="float:left;margin:4px 4px 0 0"></i>
    <input #gb type="text" pInputText size="50" style="float:left" placeholder="Global Filter">
</div>
<p-dataTable [value]="cars" [rows]="10" [paginator]="true" [globalFilter]="gb">
    <header>List of Cars</header>
    <p-column field="vin" header="Vin (startsWith)" [filter]="true"></p-column>
    <p-column field="year" header="Year (contains)" [filter]="true" filterMatchMode="contains"></p-column>
    <p-column field="brand" header="Brand (startsWith)" [filter]="true"></p-column>
    <p-column field="color" header="Color (endsWith)" [filter]="true" filterMatchMode="endsWith"></p-column>
</p-dataTable>