I prepared below SQL for myself. Also it can be useful for you. Here you are.
SELECT [t].[name] AS [Table_Name],
'-' AS Index_Name,
p.rows AS [Total_Records],
(8 * SUM(a.used_pages))/1024 AS 'Size_MB',
8 * SUM(a.used_pages) AS 'Size_KB',
p.data_compression AS "Data_Compression",
[p].[data_compression_desc] AS [Data_Compression_Desc],
p.xml_compression AS "XML_Compression",
p.xml_compression_desc AS "XML_Compression_Desc"
FROM [sys].[partitions] AS [p]
INNER JOIN sys.tables AS [t] ON [t].[object_id] = [p].[object_id]
INNER JOIN sys.allocation_units AS a ON a.container_id = p.partition_id
WHERE [p].[index_id] in (0,1)
AND t.name in ('Type_Your_Table_Name')
GROUP BY t.[name], p.rows, p.data_compression, p.data_compression_desc, p.xml_compression, p.xml_compression_desc
UNION ALL
SELECT [t].[name] AS [Table_Name],
[i].[name] AS [Index_Name],
'-' AS "Total_Records",
(8 * SUM(a.used_pages))/1024 AS 'Size_MB',
8 * SUM(a.used_pages) AS 'Size_KB',
p.data_compression AS "Data_Compression",
[p].[data_compression_desc] AS [Data_Compression_Desc],
p.xml_compression AS "XML_Compression",
p.xml_compression_desc AS "XML_Compression_Desc"
FROM [sys].[partitions] AS [p]
INNER JOIN sys.tables AS [t] ON [t].[object_id] = [p].[object_id]
INNER JOIN sys.indexes AS [i] ON [i].[object_id] = [p].[object_id] AND [i].[index_id] = [p].[index_id]
INNER JOIN sys.allocation_units AS a ON a.container_id = p.partition_id
WHERE [p].[index_id] > 1
AND t.name in ('Type_Your_Table_Name')
GROUP BY t.name, i.name, p.data_compression, p.data_compression_desc, p.xml_compression, p.xml_compression_desc