'Convert this VO Table to an `astropy.table.Table` instance.
Parameters
use_names_over_ids : bool, optional
When `True` use the ``name`` attributes of columns as the
names of columns in the `astropy.table.Table` instance.
Since names are not guaranteed to be unique, this may cause
some columns to be renamed by appending numbers to the end.
Otherwise (default), use the ID attributes as the column
names.
.. warning::
Variable-length array fields may not be restored
identically when round-tripping through the
`astropy.table.Table` instance.'

def to_table(self, use_names_over_ids=False):

    from ...table import Table
    meta = {}
    for key in [u'ID', u'name', u'ref', u'ucd', u'utype', u'description']:
        val = getattr(self, key, None)
        if (val is not None):
            meta[key] = val
    if use_names_over_ids:
        names = [field.name for field in self.fields]
        unique_names = []
        for (i, name) in enumerate(names):
            new_name = name
            i = 2
            while (new_name in unique_names):
                new_name = u'{0}{1}'.format(name, i)
                i += 1
            if six.PY2:
                new_name = new_name.encode(sys.getdefaultencoding(), u'replace')
            unique_names.append(new_name)
        array = self.array.copy()
        array.dtype.names = unique_names
        names = unique_names
    else:
        array = self.array
        names = [field.ID for field in self.fields]
    table = Table(self.array, meta=meta)
    for (name, field) in zip(names, self.fields):
        column = table[name]
        field.to_table_column(column)
    return table
