I always forget whether the first syntax compresses the NC indexes as well, so posting here so I don’t forget again!
This compresses just the clustered index (i.e. the table data):
-- Just clustered index
ALTER TABLE dbo.Table
REBUILD PARTITION = ALL
WITH (DATA_COMPRESSION = PAGE);
This compresses all indexes including the clustered index:
-- All indexes including clustered index
ALTER INDEX ALL ON dbo.Table
REBUILD PARTITION = ALL
WITH (DATA_COMPRESSION = PAGE);