Who will have to pay taxes on the P&L in a joint Demat account?

The primary or first holder of the joint demat account will be liable to pay taxes on the P&L. Though you can have a joint Demat account, your trading account will always have a single holder. Hence the single trading account holder, who will be the primary account holder for the joint Demat account, will be responsible for the tax payment.