Dividends for ordinary shares are recognized when they are paid so they are not in the balance sheet unless when they have declared the dividend and its not paid yet. In this case, there should be a dividend payable.
Dividends for preference shares are recognized every year (they accumulate) so they can be a liability at the year end when not paid.
In addition, dividends for redeemable preference shares are debt so the double entry will be debit finance cost and credit the dividends payable or the cash if they are paid.