ArcGIS for Desktop

  • Documentation
  • Pricing
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS for Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS for Desktop

A complete professional GIS

ArcGIS for Server

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Pricing
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

Help

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...

RemoveTableView

  • Summary
  • Discussion
  • Syntax
  • Code Sample

Summary

Provides the ability to remove a table within a data frame in a map document (.mxd).

Discussion

RemoveTableView will remove a single table from a specific data frame in a map document.

Syntax

RemoveTableView (data_frame, remove_table)
ParameterExplanationData Type
data_frame

A reference to a DataFrame object that contains the layer to be removed.

DataFrame
remove_table

A reference to a Layer object representing the layer to be removed.

TableView

Code Sample

RemoveTableView example

The following script will remove all tables with the name Accidents from a map document.

import arcpy
mxd = arcpy.mapping.MapDocument(r"C:\Project\Project.mxd")
for df in arcpy.mapping.ListDataFrames(mxd):
    for tbl in arcpy.mapping.ListTableViews(mxd, "", df):
        if tbl.name.lower() == "accidents":
            arcpy.mapping.RemoveTableView(df, tbl)
mxd.saveACopy(r"C:\Project\Project2.mxd")
del mxd
Feedback on this topic?

ArcGIS for Desktop

  • Home
  • Documentation
  • Pricing
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS for Desktop
  • ArcGIS for Server
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Insiders Blog
  • User Conference
  • Developer Summit
Esri
© Copyright 2016 Environmental Systems Research Institute, Inc. | Privacy | Legal