Fixed auto-close for table-related elements.